#22487: Moving from initial_data to data migrations stops test data persisting
-------------------------------------+-------------------------------------
     Reporter:  andrewgodwin         |                    Owner:
         Type:  Bug                  |  andrewgodwin
    Component:  Testing framework    |                   Status:  closed
     Severity:  Release blocker      |                  Version:
     Keywords:                       |  1.7-beta-1
    Has patch:  0                    |               Resolution:  fixed
  Needs tests:  0                    |             Triage Stage:  Accepted
Easy pickings:  0                    |      Needs documentation:  0
                                     |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by RafalP):

 Andrew,

 I have created tiny project just to see if its not me doing something
 wrong. It contains one app. This app contains three things: model,
 migrations, and tests. First migration creates table in database and
 second migration populates it with some data. At end of migration there is
 count() to make sure bulk_create succeeded. Then tests in test suite see
 if Model.objects.count() == 6.

 There are two tests cases, two tests in each. My intention was to see if
 data disappears after individual test, or tests case. Migration succeds
 meaning bulk_create did its job, but all tests fail on PostgreSQL 9.3:

 https://github.com/rafalp/django-data-migrations-bug

 So its either me being real idiot with using data migrations in tests, or
 bug 22487 is not fixed.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22487#comment:27>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.956848ebdaa777001af5779656086f57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to