summaryrefslogtreecommitdiff
path: root/tests/regressiontests/generic_inline_admin/tests.py
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-09-20 18:16:49 +0000
committerRamiro Morales <cramm0@gmail.com>2011-09-20 18:16:49 +0000
commit7b21bfc0745f92f83a6826a3d3e58797fb74e326 (patch)
treeacd08401267e495b6569e858268d94cb9f8449d4 /tests/regressiontests/generic_inline_admin/tests.py
parentfc06ec0daf563718e3ea96634040878c85bb2ebd (diff)
Improved test isolation of the admin tests and assigned custom admin sites to
prevent test order dependant failures. This involves introducing usage of `TestCase.urls` and implementing proper admin.py modules for some of the test apps. Thanks Florian Apolloner for finding the issue and contributing the patch. Refs #15294 (it solves these problems so the fix for that ticket we are going to commit doesn't introduce obscure and hard to reproduce test failures when running the Django test suite.) git-svn-id: http://code.djangoproject.com/svn/django/trunk@16856 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/generic_inline_admin/tests.py')
-rw-r--r--tests/regressiontests/generic_inline_admin/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/regressiontests/generic_inline_admin/tests.py b/tests/regressiontests/generic_inline_admin/tests.py
index da59922fe5..858d6a5f3b 100644
--- a/tests/regressiontests/generic_inline_admin/tests.py
+++ b/tests/regressiontests/generic_inline_admin/tests.py
@@ -10,10 +10,12 @@ from django.test import TestCase
# local test models
from models import (Episode, EpisodeExtra, EpisodeMaxNum, Media,
- MediaInline, EpisodePermanent, MediaPermanentInline, Category)
+ EpisodePermanent, Category)
+from admin import MediaInline, MediaPermanentInline
class GenericAdminViewTest(TestCase):
+ urls = "regressiontests.generic_inline_admin.urls"
fixtures = ['users.xml']
def setUp(self):
@@ -125,6 +127,7 @@ class GenericAdminViewTest(TestCase):
self.assertTrue(formset.get_queryset().ordered)
class GenericInlineAdminParametersTest(TestCase):
+ urls = "regressiontests.generic_inline_admin.urls"
fixtures = ['users.xml']
def setUp(self):
@@ -177,6 +180,7 @@ class GenericInlineAdminParametersTest(TestCase):
class GenericInlineAdminWithUniqueTogetherTest(TestCase):
+ urls = "regressiontests.generic_inline_admin.urls"
fixtures = ['users.xml']
def setUp(self):
@@ -203,6 +207,8 @@ class GenericInlineAdminWithUniqueTogetherTest(TestCase):
self.assertEqual(response.status_code, 302) # redirect somewhere
class NoInlineDeletionTest(TestCase):
+ urls = "regressiontests.generic_inline_admin.urls"
+
def test_no_deletion(self):
fake_site = object()
inline = MediaPermanentInline(EpisodePermanent, fake_site)
@@ -211,6 +217,7 @@ class NoInlineDeletionTest(TestCase):
self.assertFalse(formset.can_delete)
class GenericInlineModelAdminTest(TestCase):
+ urls = "regressiontests.generic_inline_admin.urls"
def setUp(self):
self.site = AdminSite()