I frequently get frustratingly opaque errors from manage.py loaddata
and related operations like the one you've illustrated here.
One possible cause is: fixtures generated from manage.py dumpdata > fixture.json
-- sans any qualifying app names -- are full of extraneous records which you may not need for your tests.
You may wish to regenerate your initial_data.json file, excluding some or all of the following:
- Admin log entries
- Content-types
(these automatically repopulate when
manage.py syncdb
and the like are
invoked)
- Sessions
- django.contrib.auth
permissions
- Any models, or entire apps, that are
specifically ancilliary to your tests (e.g.
I generally omit django-tagging
data, the tables for which can grow large
very quickly, and whose content is often orthogonal to my tests)
If you need everything in your fixture, you can also try breaking it into two or more fixture files.