I have a django project using multiple databases. I am using django-nose as the test runner. Test data is loaded to the default database using fixtures. I have a second database not managed by django models, where I want to create a structure and load some data before testing, using raw sql.
Is there any way to do this in a somehow clean way?
Thank you.
Ht Stathis,
Here was my scenario and how I solved it – YMMV..
1) I build up a testrunner and overriding the setup_databases method. I needed to do this because I wanted to externally create this database. We had custom tables, and functions. I literally used the same code with one small deviation
2) Add this to your settings.py
TEST_RUNNER = 'IManageTestRunner'3) Once this was created then I knew my test db was created. I would then create tests which populated externally and test the results against it.
Hope that helps took me awhile to figure it out. I still have one issue (doing repeat inserts/queries..)