Alex Rivera | Logout

don't load 'initial_data.json' fixture when testing

Asked 2010-11-10T15:42:21.510
14

I'm testing a django app not written by myself, which uses two fixtures: initial_data.json and testing.json. Both fixtures files contain conflicting data (throwing an integrity error).

For testing, I've specified TestCase.fixtures = ['testing.json'], but initial_data.json is loaded too.

How can I avoid loading initial_data.json (not renaming it) in the testcase?

Edit
Report

1 Answer

2

You might want to think about whether initial_data.json is something your app actually needs. It's not hard to "manually" load your production data with ./manage.py loaddata production.json after running a syncdb (how often do you run syncdb in production, anyway?), and it would make loading your testing fixture much easier.

answered 2013-02-09T00:35:02.827

Your Answer