1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #19508 -- Implemented uri_to_iri as per RFC.

Thanks Loic Bistuer for helping in shaping the patch and Claude Paroz
for the review.
This commit is contained in:
Anubhav Joshi
2014-07-22 17:55:22 +05:30
committed by Loic Bistuer
parent 3af5af1a61
commit 10b17a22be
9 changed files with 189 additions and 42 deletions

View File

@@ -161,3 +161,28 @@ class HandlerSuspiciousOpsTest(TestCase):
def test_suspiciousop_in_view_returns_400(self):
response = self.client.get('/suspicious/')
self.assertEqual(response.status_code, 400)
@override_settings(ROOT_URLCONF='handlers.urls')
class HandlerNotFoundTest(TestCase):
def test_invalid_urls(self):
response = self.client.get('~%A9helloworld')
self.assertEqual(response.status_code, 404)
self.assertContains(response, '~%A9helloworld', status_code=404)
response = self.client.get('d%aao%aaw%aan%aal%aao%aaa%aad%aa/')
self.assertEqual(response.status_code, 404)
self.assertContains(response, 'd%AAo%AAw%AAn%AAl%AAo%AAa%AAd%AA', status_code=404)
response = self.client.get('/%E2%99%E2%99%A5/')
self.assertEqual(response.status_code, 404)
self.assertContains(response, '%E2%99\u2665', status_code=404)
response = self.client.get('/%E2%98%8E%E2%A9%E2%99%A5/')
self.assertEqual(response.status_code, 404)
self.assertContains(response, '\u260e%E2%A9\u2665', status_code=404)
def test_environ_path_info_type(self):
environ = RequestFactory().get('/%E2%A8%87%87%A5%E2%A8%A0').environ
self.assertIsInstance(environ['PATH_INFO'], six.text_type)