diff --git a/wagtail/contrib/wagtailroutablepage/models.py b/wagtail/contrib/wagtailroutablepage/models.py index cd98191a5a..1ce76fd8c2 100644 --- a/wagtail/contrib/wagtailroutablepage/models.py +++ b/wagtail/contrib/wagtailroutablepage/models.py @@ -45,7 +45,7 @@ class RoutablePageMixin(object): @classmethod def check(cls, **kwargs): - if cls.subpage_urls: + if cls.subpage_urls and not hasattr(cls, '_disable_subpage_urls_deprecation_warning'): warnings.warn( "{app_label}.{classname}: subpage_urls is deprecated. Use the " "@route decorator to define page routes instead.".format( diff --git a/wagtail/tests/routablepage/models.py b/wagtail/tests/routablepage/models.py index eaf0cee031..36f1447aa0 100644 --- a/wagtail/tests/routablepage/models.py +++ b/wagtail/tests/routablepage/models.py @@ -16,6 +16,9 @@ class OldStyleRoutablePageTest(RoutablePage): url(r'^external/(.+)/$', routable_page_external_view, name='external_view') ) + # Don't show deprecation warning for this class to keep test log clean + _disable_subpage_urls_deprecation_warning = True + def archive_by_year(self, request, year): return HttpResponse("ARCHIVE BY YEAR: " + str(year))