2014-08-12 14:54:42 +00:00
|
|
|
import warnings
|
|
|
|
|
2014-04-02 00:46:34 +00:00
|
|
|
from django.conf.urls import url
|
2014-11-26 21:21:29 +00:00
|
|
|
from django.utils.deprecation import RemovedInDjango20Warning
|
2011-06-16 16:41:14 +00:00
|
|
|
|
2014-06-03 11:30:14 +00:00
|
|
|
from . import views
|
|
|
|
|
2014-08-12 14:54:42 +00:00
|
|
|
# Test deprecated behavior of passing strings as view to url().
|
|
|
|
# Some of these can be removed in Django 2.0 as they aren't convertable to
|
2014-11-26 21:21:29 +00:00
|
|
|
# callables.
|
|
|
|
with warnings.catch_warnings():
|
|
|
|
warnings.filterwarnings('ignore', category=RemovedInDjango20Warning)
|
2014-08-12 14:54:42 +00:00
|
|
|
urlpatterns = [
|
|
|
|
# View has erroneous import
|
|
|
|
url(r'erroneous_inner/$', views.erroneous_view),
|
|
|
|
# Module has erroneous import
|
|
|
|
url(r'erroneous_outer/$', 'urlpatterns_reverse.erroneous_views_module.erroneous_view'),
|
|
|
|
# Module is an unqualified string
|
|
|
|
url(r'erroneous_unqualified/$', 'unqualified_view'),
|
|
|
|
# View does not exist
|
|
|
|
url(r'missing_inner/$', 'urlpatterns_reverse.views.missing_view'),
|
2015-04-24 19:51:26 +00:00
|
|
|
# View is not a callable (string import; arbitrary Python object)
|
|
|
|
url(r'uncallable-dotted/$', 'urlpatterns_reverse.views.uncallable'),
|
|
|
|
# View is not a callable (explicit import; arbitrary Python object)
|
|
|
|
url(r'uncallable-object/$', views.uncallable),
|
2014-08-12 14:54:42 +00:00
|
|
|
# Module does not exist
|
|
|
|
url(r'missing_outer/$', 'urlpatterns_reverse.missing_module.missing_view'),
|
|
|
|
# Regex contains an error (refs #6170)
|
|
|
|
url(r'(regex_error/$', views.empty_view),
|
|
|
|
]
|