diff options
author | Claude Paroz <claude@2xlibre.net> | 2015-02-06 23:25:15 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2015-02-08 20:55:09 +0100 |
commit | 32e6a7d3a57b2287d55e8b8efa4e8cb7643b1720 (patch) | |
tree | 305218f5ea11a368ae1c167d52bcd8d65da8b037 /tests/admin_custom_urls | |
parent | 9033003d97d29f7754b0840333f6f362c0cd31f7 (diff) | |
download | django-32e6a7d3a57b2287d55e8b8efa4e8cb7643b1720.tar.gz |
Replaced hardcoded URLs in admin_* tests
Refs #15779. This will allow easier admin URL changes, when needed.
Thanks Simon Charette for the review.
Diffstat (limited to 'tests/admin_custom_urls')
-rw-r--r-- | tests/admin_custom_urls/tests.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index 3260bc603c..c2d5ad4994 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -26,7 +26,9 @@ class AdminCustomUrlsTest(TestCase): """ Ensure GET on the add_view works. """ - response = self.client.get('/admin/admin_custom_urls/action/!add/') + add_url = reverse('admin:admin_custom_urls_action_add') + self.assertTrue(add_url.endswith('/!add/')) + response = self.client.get(add_url) self.assertIsInstance(response, TemplateResponse) self.assertEqual(response.status_code, 200) @@ -35,7 +37,7 @@ class AdminCustomUrlsTest(TestCase): Ensure GET on the add_view plus specifying a field value in the query string works. """ - response = self.client.get('/admin/admin_custom_urls/action/!add/', {'name': 'My Action'}) + response = self.client.get(reverse('admin:admin_custom_urls_action_add'), {'name': 'My Action'}) self.assertEqual(response.status_code, 200) self.assertContains(response, 'value="My Action"') @@ -48,7 +50,7 @@ class AdminCustomUrlsTest(TestCase): "name": 'Action added through a popup', "description": "Description of added action", } - response = self.client.post('/admin/admin_custom_urls/action/!add/', post_data) + response = self.client.post(reverse('admin:admin_custom_urls_action_add'), post_data) self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissAddRelatedObjectPopup') self.assertContains(response, 'Action added through a popup') |