浏览代码

Update deprecation warning for get_document_model

- ensure warning is present for the next two releases
LB 5 年之前
父节点
当前提交
985e5b2274
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      wagtail/documents/models.py
  2. 2 2
      wagtail/documents/tests/test_models.py

+ 2 - 2
wagtail/documents/models.py

@@ -14,7 +14,7 @@ from wagtail.admin.models import get_object_usage
 from wagtail.core.models import CollectionMember
 from wagtail.search import index
 from wagtail.search.queryset import SearchableQuerySetMixin
-from wagtail.utils.deprecation import RemovedInWagtail29Warning
+from wagtail.utils.deprecation import RemovedInWagtail210Warning
 
 
 class DocumentQuerySet(SearchableQuerySetMixin, models.QuerySet):
@@ -24,7 +24,7 @@ class DocumentQuerySet(SearchableQuerySetMixin, models.QuerySet):
 def get_document_model():
     warnings.warn("wagtail.documents.models.get_document_model "
                   "has been moved to wagtail.documents.get_document_model",
-                  RemovedInWagtail29Warning)
+                  RemovedInWagtail210Warning)
     from wagtail.documents import get_document_model
     return get_document_model()
 

+ 2 - 2
wagtail/documents/tests/test_models.py

@@ -14,7 +14,7 @@ from wagtail.documents import get_document_model, get_document_model_string, mod
 from wagtail.images.tests.utils import get_test_image_file
 from wagtail.tests.testapp.models import CustomDocument
 from wagtail.tests.utils import WagtailTestUtils
-from wagtail.utils.deprecation import RemovedInWagtail29Warning
+from wagtail.utils.deprecation import RemovedInWagtail210Warning
 
 
 class TestDocumentQuerySet(TestCase):
@@ -212,4 +212,4 @@ class TestGetDocumentModel(WagtailTestUtils, TestCase):
 
             self.assertIs(Document, get_document_model())
             self.assertEqual(len(ws), 1)
-            self.assertIs(ws[0].category, RemovedInWagtail29Warning)
+            self.assertIs(ws[0].category, RemovedInWagtail210Warning)