#25251: Inconsistent availability of data migrations in TransactionTestCase when
using --keepdb
-----------------------------------+------------------------------------
     Reporter:  davidszotten       |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  1.8
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by romgar):

 I'm facing the same problem: my initial data are no more in the database
 at the end of my test suite, even with `--keepdb` option.
 As `TransactionTestCase` is always flushing data on the `tearDown`, why
 not reloading the serialized data after the flush, instead of on the
 `setUp` step ?
 I have tried a naive approach by moving the logic related  to string
 serialized data loading on the `tearDown` step,
 
https://github.com/romgar/django/commit/7219308cf8f196463d03d1407b0ad0e9b918a3db
 and the data is then kept.
 Not really sure about any other impact anywhere else.
 I run the django test suite without any failure.
 Any feedbacks on that ?

--
Ticket URL: <https://code.djangoproject.com/ticket/25251#comment:3>
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.7d9290a361ec8374b4cdb2b787bbfa79%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to