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.
* status: new => closed
* needs_docs: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
I believe this should be resolved by #23699 in yet to be released 1.7.2.
Can you please test with stable/1.7.x and reopen if not?
--
Ticket URL: <https://code.djangoproject.com/ticket/24023#comment:1>
Comment (by alexhayes):
I can confirm that this issue has indeed been resolved in 1.7.2.
--
Ticket URL: <https://code.djangoproject.com/ticket/24023#comment:2>