On Tue, Aug 26, 2008 at 11:18 PM, dchandek <[EMAIL PROTECTED]> wrote: > > After several iterations of running tests on an application (manage.py > test myapp), I have these observations which are not really clear in > the documentation: > > 1. All initial_data fixtures (not just those for the tested app) are > always loaded into the test database.
Yes, by design. If you don't want this to happen, reconsider whether your data is actually initial data. > 2. Because there is no means to specify fixtures for doctests, you > must have an initial_data fixture to run model doctests against the > test database if existing data is required for the tests. (The > documentation simply says 'Each doctest begins with a "blank slate" — > a fresh database containing an empty table for each model.') That documentation isn't completely correct - it needs to be slightly reworded. doctests do no special setup - that means they inherit whatever database conditions are present when they execute. If there is only 1 doctest, this means a clean test database with initial data loaded; if there are other tests, there could be leftover detritus from other tests. However, regarding fixtures in doctests: See #5624 and #8138. > 3. Loading specific fixtures in django.test.TestCase instances is not > echoed to stdout. (The documentation is clear that the test database > is flushed before each test.) Why should they be echoed? If you have 200 tests, you don't want 200 lines to output saying "loaded fixture X". Your test declares the fixture that has been loaded; you only get output (and error output at that) if the fixture fails to load. > 4. django.test.TestCase effectively reloads initial_data fixtures with > every test because it calls the flush command. Again, by design. Why shouldn't it? 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---

