#24023: Apps with intial_data and migrations kill test runner
-----------------------------------+--------------------
Reporter: alexhayes | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
It appears that in Django 1.7.1 when you run `manage.py test` it attempts
to `loaddata` for apps with `initial_data.*` prior(1) to the migrations
for those apps being applied.
According to the docs the loading of initial_data.* files has been
deprecated in 1.7.
I would expect and assume that this is true for running tests also,
however what happens is that the tests attempt to load the initial data
which results in a django.db.utils.OperationalError (essentially it
attempts to load the data but the tables don't exist).
I've created a github repo of a project that illustrates the issue and
contains a trace - see https://github.com/alexhayes/apps-with-migrations-
and-initial-data-break-tests
As outlined in the projects readme I would expect that the tests
completely ignore the initial_data.* files for apps that have migrations
(as migrate does now) and that I have to create a data migration, as
outlined in the documentation.
The obvious workaround for this is just remove the `initial_data.*` files
however it's not clear in the documentation that this is the case.
(1) Note, as detailed in my example github project, the migrations are
indeed run prior to load data, but they don't seem to be applied.
--
Ticket URL: <https://code.djangoproject.com/ticket/24023>
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/052.e3f46221b9c467e92d07d1c2de23e6c1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.