summaryrefslogtreecommitdiff
path: root/tests/admin_custom_urls
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2014-01-14 15:43:27 +0000
committerMarc Tamlyn <marc.tamlyn@gmail.com>2014-01-14 15:43:27 +0000
commit2607fa901699916c4825f145fa8a84f49b8524ff (patch)
treee211144ca488e24b1b00deda973b5f6bea482843 /tests/admin_custom_urls
parentac8d0a48157c4a53f971cf2450cb6c8ee6c05f36 (diff)
downloaddjango-2607fa901699916c4825f145fa8a84f49b8524ff.tar.gz
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.
Diffstat (limited to 'tests/admin_custom_urls')
-rw-r--r--tests/admin_custom_urls/tests.py10
1 files changed, 6 insertions, 4 deletions
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
'<app name>/<model name>/!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):