mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
path()
This commit is contained in:
parent
4a386afcb1
commit
5aae54bc60
|
@ -61,7 +61,7 @@ class FormatSuffixTests(TestCase):
|
||||||
|
|
||||||
def test_trailing_slash(self):
|
def test_trailing_slash(self):
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path(r'^test/$', dummy_view),
|
path('test/', dummy_view),
|
||||||
]
|
]
|
||||||
self._test_trailing_slash(urlpatterns)
|
self._test_trailing_slash(urlpatterns)
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class FormatSuffixTests(TestCase):
|
||||||
|
|
||||||
def test_format_suffix(self):
|
def test_format_suffix(self):
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path(r'^test$', dummy_view),
|
path('test', dummy_view),
|
||||||
]
|
]
|
||||||
self._test_format_suffix(urlpatterns)
|
self._test_format_suffix(urlpatterns)
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class FormatSuffixTests(TestCase):
|
||||||
def test_format_suffix_django2_args(self):
|
def test_format_suffix_django2_args(self):
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('convtest/<int:pk>', dummy_view),
|
path('convtest/<int:pk>', dummy_view),
|
||||||
re_path(r'^retest/(?P<pk>[0-9]+)$', dummy_view),
|
path('retest/<int:pk>', dummy_view),
|
||||||
]
|
]
|
||||||
test_paths = [
|
test_paths = [
|
||||||
URLTestPath('/convtest/42', (), {'pk': 42}),
|
URLTestPath('/convtest/42', (), {'pk': 42}),
|
||||||
|
@ -119,7 +119,7 @@ class FormatSuffixTests(TestCase):
|
||||||
|
|
||||||
def test_default_args(self):
|
def test_default_args(self):
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path(r'^test$', dummy_view, {'foo': 'bar'}),
|
path('test', dummy_view, {'foo': 'bar'}),
|
||||||
]
|
]
|
||||||
self._test_default_args(urlpatterns)
|
self._test_default_args(urlpatterns)
|
||||||
|
|
||||||
|
@ -140,10 +140,10 @@ class FormatSuffixTests(TestCase):
|
||||||
|
|
||||||
def test_included_urls(self):
|
def test_included_urls(self):
|
||||||
nested_patterns = [
|
nested_patterns = [
|
||||||
re_path(r'^path$', dummy_view)
|
path('path', dummy_view)
|
||||||
]
|
]
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path(r'^test/', include(nested_patterns), {'foo': 'bar'}),
|
path('test/', include(nested_patterns), {'foo': 'bar'}),
|
||||||
]
|
]
|
||||||
self._test_included_urls(urlpatterns)
|
self._test_included_urls(urlpatterns)
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ class FormatSuffixTests(TestCase):
|
||||||
path('path', dummy_view)
|
path('path', dummy_view)
|
||||||
]
|
]
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path('^test/', include(nested_patterns), {'foo': 'bar'}),
|
path('test/', include(nested_patterns), {'foo': 'bar'}),
|
||||||
]
|
]
|
||||||
self._test_included_urls(urlpatterns)
|
self._test_included_urls(urlpatterns)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user