kopia lustrzana https://github.com/wagtail/wagtail
Hide subpage_urls deprecation warning in tests
rodzic
4b4b4bcc74
commit
122c524a1c
|
@ -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(
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue