aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests
diff options
context:
space:
mode:
authorPaul Melnikow2014-01-04 16:57:50 -0500
committerPaul Melnikow2014-01-04 16:57:50 -0500
commit3cd15fb1713dfc49e1bf1fd48045ca3ae5654e18 (patch)
tree850fde84f1b288fcbf440f88f693a3eb7a1f9b80 /rest_framework/tests
parenta1d7aa8f712b659f9d8302a2d2a098d2538e6c89 (diff)
downloaddjango-rest-framework-3cd15fb1713dfc49e1bf1fd48045ca3ae5654e18.tar.bz2
Router: Do not automatically adjust lookup_regex when trailing_slash is True
BREAKING CHANGE When trailing_slash is set to True, the router no longer will adjust the lookup regex to allow it to include periods. To simulate the old behavior, the programmer should specify `lookup_regex = '[^/]+'` on the viewset. https://github.com/tomchristie/django-rest-framework/pull/1328#issuecomment-31517099
Diffstat (limited to 'rest_framework/tests')
-rw-r--r--rest_framework/tests/test_routers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/tests/test_routers.py b/rest_framework/tests/test_routers.py
index 0f6d62c7..e41da57f 100644
--- a/rest_framework/tests/test_routers.py
+++ b/rest_framework/tests/test_routers.py
@@ -152,7 +152,7 @@ class TestTrailingSlashIncluded(TestCase):
self.urls = self.router.urls
def test_urls_have_trailing_slash_by_default(self):
- expected = ['^notes/$', '^notes/(?P<pk>[^/]+)/$']
+ expected = ['^notes/$', '^notes/(?P<pk>[^/.]+)/$']
for idx in range(len(expected)):
self.assertEqual(expected[idx], self.urls[idx].regex.pattern)