Hide subpage_urls deprecation warning in tests

pull/1211/merge
Karl Hobley 2015-04-24 16:40:12 +01:00 zatwierdzone przez Matt Westcott
rodzic 4b4b4bcc74
commit 122c524a1c
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

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

Wyświetl plik

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