#14661: A couple of MySQL/MyISAM test failures
----------------------------------------+-----------------------------------
          Reporter:  kmtracey           |         Owner:  nobody 
            Status:  new                |     Milestone:  1.3    
         Component:  Testing framework  |       Version:  1.2    
        Resolution:                     |      Keywords:  blocker
             Stage:  Accepted           |     Has_patch:  0      
        Needs_docs:  0                  |   Needs_tests:  0      
Needs_better_patch:  0                  |  
----------------------------------------+-----------------------------------
Comment (by russellm):

 It turns out that the initial_sql failure points to a pretty major
 problem.

 Using our current test setup, a TransactionTestCase calls flush() to clear
 the database and reinstall initial data.

 However, a flush *doesn't* re-run custom SQL. This is a good thing if the
 custom SQL is table modifications, etc, but if you're using custom SQL to
 load initial data -- such as the test is doing -- you're out of luck. Once
 the database has been flushed, you've lost all your initial data.

 The test fails reliably under MySQL MyISAM because of the lack of
 transaction support -- all test cases are transaction test cases. However,
 you could get the same effect as long as a transaction test case *of any
 kind* runs before the initial data test.

 Essentially, this has *always* been broken; we've just never noticed, and
 our old test case only validated against syntax errors -- it didn't
 actually check anything worked.

 I can see two solutions:
  1) Document, post-facto, the fact that custom SQL can't be used for test
 data.
  2) Introduce a different type of custom SQL that can be used for initial
 data.

 Neither of these is especially backwards compatible.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14661#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to