On Wed, Apr 15, 2009 at 2:28 PM, Sean Legassick <[email protected]>wrote:

>
> (I'm posting this here rather than filing a ticket, because I'm not
> sure whether I'm missing something. If I'm not than I will file a
> ticket with a patch).
>
> 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?
>

TestCase testcases should not be running after TransactionTestCase
testcases.  I had this concern prior to checking in the test changes (see
http://groups.google.com/group/django-developers/browse_thread/thread/1e4f4c840b180895/)
and (thought) I addressed it by adding code to reorder the test suite after
all the tests are discovered so that all TestCase testcases (which assume a
clean DB on entry and ensure one on exit) are run first.  It's even
documented (
http://docs.djangoproject.com/en/dev/topics/testing/#django.test.TransactionTestCase)
since the reordering revealed a few testcase-order dependent bugs in the
Django test suite so might also cause hiccups for people with their own
suites when upgrading to 1.1.

Are you actually seeing TestCases run after TransactionTestCases?

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to