2014-08-12 22:54:42 +08:00
|
|
|
import warnings
|
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
from django.conf.urls import url
|
2015-06-23 01:54:35 +08:00
|
|
|
from django.utils.deprecation import RemovedInDjango110Warning
|
2011-06-17 00:41:14 +08:00
|
|
|
|
2014-06-03 19:30:14 +08:00
|
|
|
from . import views
|
|
|
|
|
2014-08-12 22:54:42 +08:00
|
|
|
# Test deprecated behavior of passing strings as view to url().
|
2015-06-23 01:54:35 +08:00
|
|
|
# Some of these can be removed in Django 1.10 as they aren't convertable to
|
2014-11-27 05:21:29 +08:00
|
|
|
# callables.
|
|
|
|
with warnings.catch_warnings():
|
2015-06-23 01:54:35 +08:00
|
|
|
warnings.filterwarnings('ignore', category=RemovedInDjango110Warning)
|
2014-08-12 22:54:42 +08: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-25 03:51:26 +08: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 22:54:42 +08: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),
|
|
|
|
]
|