Hi Russ, I *did* try loading fixtures by making use of Django's own TestCase.
However, this proved to be too expensive in terms of time taken to run tests given that: 1) Deriving test classes from Django's TestCase slows execution down considerably, even in the *absence* of fixtures. 2) As my test data is static and unchanging there is no reason to load it before each test case/method. (More about my travails here: http://lawfulsamurai.blogspot.com/2007/06/django-testing-gotchas.html) I do agree that initial_data is intended for data that must always be in the db. I guess I should rephrase my question thus: How can I load static, one-time-load data for use with test cases without using either Django's TestCase or initial_data? Many Thanks, Manoj On Jul 17, 11:15 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/17/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > > > > I have created an initial_data fixture for using with my test cases. > > However I do not want these to be loaded every time I run syncdb after > > making a change during development. Is there a way to turn off loading > > initial_data, perhaps using a command line switch? > > initial_data is intended for data that must _always_ be in your database. > > If you have a need for data for a particular test that isn't required > for normal operation, put it in a different fixture name, and direct > Django to load that fixture during testing. To do this, use a Django > TestCase, defining a fixtures attribute: > > from django.test import TestCase > > class MyTest(TestCase): > fixtures = ['test_data.json'] > > def test_something(self): > ... > > In this example, 'test_data.json' will be loaded into the database > before running the test_something testcase. > > Yours, > Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---