Used override of default database setting based on the DB env var present on travis-ci.

This commit is contained in:
Dirk Eschler 2012-10-25 11:09:22 +02:00
parent 20f8bbb92c
commit aa274b72a2
2 changed files with 20 additions and 4 deletions

View file

@ -7,9 +7,9 @@ env:
- DJANGO=1.3.4 DB=sqlite
- DJANGO=1.3.4 DB=postgres
- DJANGO=1.3.4 DB=mysql
#- DJANGO=1.4.2 DB=sqlite
#- DJANGO=1.4.2 DB=postgres
#- DJANGO=1.4.2 DB=mysql
- DJANGO=1.4.2 DB=sqlite
- DJANGO=1.4.2 DB=postgres
- DJANGO=1.4.2 DB=mysql
before_script:
- pep8 modeltranslation
- pyflakes modeltranslation

View file

@ -10,9 +10,25 @@ DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIRNAME, 'test.db')
'NAME': os.path.join(DIRNAME, 'modeltranslation.db')
}
}
test_db = os.environ.get('DB', 'sqlite')
if test_db == 'mysql':
DATABASES['default'].update({
'ENGINE': 'django.db.backends.mysql',
'NAME': 'modeltranslation',
'USER': 'root',
})
elif test_db == 'postgres':
DATABASES['default'].update({
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'NAME': 'modeltranslation',
'OPTIONS': {
'autocommit': True,
}
})
INSTALLED_APPS = (
'django.contrib.auth',