I am writing test cases for a Django application. I want to use different databases for different test cases. Hence, I want to override the default database settings for a particular test case.
e.g.
class FooTest(TestCase):
fixtures = ['df_fixtures1.json']
def setUp(self):
print "SETTING UP?"
def tearDown(self):
print "Tear Down"
@override_settings(DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3'})
def do_foo_related(self):
Foo task.....
pass
This does not work, but this is what I want. Is there anyway to do something like this?
Edit: I am using django1.5