Update deprecation warning for get_document_model

- ensure warning is present for the next two releases
pull/5689/head
LB 2019-11-07 12:35:55 +10:00
rodzic 06fb0764e0
commit 985e5b2274
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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)