summaryrefslogtreecommitdiff
path: root/tests/handlers/tests.py
diff options
context:
space:
mode:
authorAnubhav Joshi <anubhav9042@gmail.com>2014-07-22 17:55:22 +0530
committerLoic Bistuer <loic.bistuer@gmail.com>2014-10-16 02:31:17 +0700
commit10b17a22bec2eaf44c3315614aea87c127caee46 (patch)
tree39145c16ca06aa33050e1642076db4216d663a10 /tests/handlers/tests.py
parent3af5af1a61d73c533aca4fb0ea1f53e4f6300b17 (diff)
Fixed #19508 -- Implemented uri_to_iri as per RFC.
Thanks Loic Bistuer for helping in shaping the patch and Claude Paroz for the review.
Diffstat (limited to 'tests/handlers/tests.py')
-rw-r--r--tests/handlers/tests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py
index 689b0ed9d8..f574418ae2 100644
--- a/tests/handlers/tests.py
+++ b/tests/handlers/tests.py
@@ -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)