Skip to content

Commit

Permalink
Fixed #9592 -- Create data for the generic_inline_admin test during s…
Browse files Browse the repository at this point in the history
…etup instead of via a fixutre since it uses a content type id which will vary depending on what other tests have been run.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
kmtracey committed Nov 14, 2008
1 parent 64b5644 commit 02e67bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 0 additions & 11 deletions tests/regressiontests/generic_inline_admin/fixtures/model-data.xml

This file was deleted.

9 changes: 8 additions & 1 deletion tests/regressiontests/generic_inline_admin/tests.py
Expand Up @@ -7,7 +7,7 @@
from models import Episode, Media

class GenericAdminViewTest(TestCase):
fixtures = ['users.xml', 'model-data.xml']
fixtures = ['users.xml']

def setUp(self):
# set TEMPLATE_DEBUG to True to ensure {% include %} will raise
Expand All @@ -16,6 +16,13 @@ def setUp(self):
self.original_template_debug = settings.TEMPLATE_DEBUG
settings.TEMPLATE_DEBUG = True
self.client.login(username='super', password='secret')

# Can't load content via a fixture (since the GenericForeignKey
# relies on content type IDs, which will vary depending on what
# other tests have been run), thus we do it here.
e = Episode.objects.create(name='This Week in Django')
m = Media(content_object=e, url='http://example.com/podcast.mp3')
m.save()

def tearDown(self):
self.client.logout()
Expand Down

0 comments on commit 02e67bb

Please sign in to comment.