DATABASES = {
# \'default\': {
# \'ENGINE\': \'postgresql_psycopg2\',
# ...
# }
# for unit tests
\'default\': {
\'ENGINE\': \'dj
Though this is already solved...
If your database for tests is just a normal DB:
I think you are not doing unit test since you rely in the database. Anyway, django contains a test type for that (not unitary): django.test.TestCase
You need to derive from django.test.TestCase
instead of unittest.TestCase
that will create a fresh rehershal database for you that will be destroyed when the test end.
There are interesting explanations/tips about testing with db in the following link
Testing Django Applications