From 2607fa901699916c4825f145fa8a84f49b8524ff Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Tue, 14 Jan 2014 15:43:27 +0000 Subject: Fixed #21774 -- Isolate all test urls from eachother. This (nearly) completes the work to isolate all the test modules from each other. This is now more important as importing models from another module will case PendingDeprecationWarnings if those modules are not in INSTALLED_APPS. The only remaining obvious dependencies are: - d.c.auth depends on d.c.admin (because of the is_admin flag to some views), but this is not so important and d.c.admin is in always_installed_apps - test_client_regress depends on test_client. Eventually these should become a single module, as the split serves no useful purpose. --- tests/admin_custom_urls/tests.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/admin_custom_urls') diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py index d629c78e04..7f098b049b 100644 --- a/tests/admin_custom_urls/tests.py +++ b/tests/admin_custom_urls/tests.py @@ -16,6 +16,7 @@ class AdminCustomUrlsTest(TestCase): * The ModelAdmin for Action customizes the add_view URL, it's '//!add/' """ + urls = 'admin_custom_urls.urls' fixtures = ['users.json', 'actions.json'] def setUp(self): @@ -28,7 +29,7 @@ class AdminCustomUrlsTest(TestCase): """ Ensure GET on the add_view works. """ - response = self.client.get('/custom_urls/admin/admin_custom_urls/action/!add/') + response = self.client.get('/admin/admin_custom_urls/action/!add/') self.assertIsInstance(response, TemplateResponse) self.assertEqual(response.status_code, 200) @@ -37,7 +38,7 @@ class AdminCustomUrlsTest(TestCase): Ensure GET on the add_view plus specifying a field value in the query string works. """ - response = self.client.get('/custom_urls/admin/admin_custom_urls/action/!add/', {'name': 'My Action'}) + response = self.client.get('/admin/admin_custom_urls/action/!add/', {'name': 'My Action'}) self.assertEqual(response.status_code, 200) self.assertContains(response, 'value="My Action"') @@ -50,7 +51,7 @@ class AdminCustomUrlsTest(TestCase): "name": 'Action added through a popup', "description": "Description of added action", } - response = self.client.post('/custom_urls/admin/admin_custom_urls/action/!add/', post_data) + response = self.client.post('/admin/admin_custom_urls/action/!add/', post_data) self.assertEqual(response.status_code, 200) self.assertContains(response, 'dismissAddAnotherPopup') self.assertContains(response, 'Action added through a popup') @@ -61,7 +62,7 @@ class AdminCustomUrlsTest(TestCase): """ # Should get the change_view for model instance with PK 'add', not show # the add_view - response = self.client.get('/custom_urls/admin/admin_custom_urls/action/add/') + response = self.client.get('/admin/admin_custom_urls/action/add/') self.assertEqual(response.status_code, 200) self.assertContains(response, 'Change action') @@ -84,6 +85,7 @@ class AdminCustomUrlsTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class CustomRedirects(TestCase): + urls = 'admin_custom_urls.urls' fixtures = ['users.json', 'actions.json'] def setUp(self): -- cgit v1.2.1