#22487: Moving from initial_data to data migrations stops test data persisting
-------------------------------------+-------------------------------------
Reporter: andrewgodwin | Owner:
Type: Bug | andrewgodwin
Component: Testing framework | Status: assigned
Severity: Release blocker | Version:
Keywords: | 1.7-beta-1
Has patch: 0 | Resolution:
Needs tests: 0 | Triage Stage: Accepted
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by andrewgodwin):
I have done some exploratory work on this, and implemented the dump-into-
memory-and-restore-after-each-test solution here:
https://github.com/django/django/pull/2643
It seems to not break - I haven't tested if it fully works yet - but it
does slow the runtime of TransactionTestCases down by a factor of 3 (the
schema/migrations test suite goes from 6 seconds to 18 seconds under
PostgreSQL).
Tests can opt out of the new behaviour by setting `serialized_rollback =
False` on the TestCase, which speeds things up again, so I think overall
it's not _too_ bad. Would appreciate some comments, though. There's the
possibility we could default that to `False` (nothing in Django's main
tests needs it turned on), and then just document that users who are
loading data in migrations probably want it on for their
`TransactionTestCase`s and/or their main tests if they're on MyISAM.
--
Ticket URL: <https://code.djangoproject.com/ticket/22487#comment:6>
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.ee86384d2d08ec7db719c132719b3068%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.