On Apr 15, 2009, at 2:28 PM, Sean Legassick wrote:
> It strikes me that TransactionTestCase should be flushing the database > in the teardown stage of the test case rather than the setup. My > thinking is that when using a mixture of TestCase and > TransactionTestCase (where the latter is only used when testing > transaction-related behaviour) what's important is that the test db is > left in the 'clean' state at the end of the test. Otherwise subsequent > TestCase tests will be operating on a test db with any modifications > made by the TransactionTestCase test still in place, and thus > potentially failing. > > So am I missing something or should this be changed? > > Sean As someone who's managed to hard-crash the Python interpreter while building tests for the test suite, they most definitely should be in the setup phase. It's the only way to ensure that right before your test starts, no matter what horrible things happened previously, your test DB will stay intact. If there's a need for end cleaning as well, I don't know. I'll let someone smarter than I speak to that. George --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---
