-
-
Save atlasloewenherz/8550904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Since we need a syncdb on all the databases, before the tests can be | |
# runned successfully we need to execute | |
# | |
# $ python manage.py syncdb | |
# $ python manage.py syncdb --database=test | |
# | |
# otherwise will be errors like | |
# | |
# 'django.db.utils.DatabaseError: no such table: django_site' | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'bla', | |
'USER': 'foo' | |
'PASSWORD': 'bar' | |
}, | |
'test': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': 'only4test.sqlite' | |
}, | |
} | |
# http://stackoverflow.com/questions/4650509/different-db-for-testing-in-django | |
import sys | |
if 'test' in sys.argv: | |
DATABASES['default'] = DATABASES['test']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment