From 8cbda630aa003532f9dcb8cdb75efc932c2f9d43 Mon Sep 17 00:00:00 2001 From: bansalnitish Date: Fri, 9 Mar 2018 00:10:39 +0530 Subject: [PATCH] added test --- readthedocs/rtd_tests/tests/test_views.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/readthedocs/rtd_tests/tests/test_views.py b/readthedocs/rtd_tests/tests/test_views.py index a3fdad5f4d8..5f770858a8d 100644 --- a/readthedocs/rtd_tests/tests/test_views.py +++ b/readthedocs/rtd_tests/tests/test_views.py @@ -241,3 +241,18 @@ def test_project_admins_can_delete_subprojects_that_they_are_not_admin_of(self): '/dashboard/my-mainproject/subprojects/my-subproject/delete/') self.assertEqual(response.status_code, 302) self.assertTrue(self.subproject not in [r.child for r in self.project.subprojects.all()]) + + +class URLResolution(TestCase): + def setUp(self): + self.user = new(User, username='foo+bar') + self.user.set_password('test') + self.user.save() + + self.project = get(Project, slug='my-mainproject') + self.client.login(username='foo+bar', password='test') + + def test_project_details_resolve(self): + self.project.users.add(self.user) + response = self.client.get('/projects/my-mainproject/') + self.assertEqual(response.status_code, 200)