Skip to content

Commit

Permalink
Fix Travis tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radiac committed Sep 16, 2018
1 parent 6674ca7 commit 3f0c527
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ env:
- TOXENV=py34-django2.0
- TOXENV=py35-django2.0
- TOXENV=py36-django2.0
- TOXENV=py35-django2.1
- TOXENV=py36-django2.1
matrix:
include:
- python: '3.5'
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ def runtests(args):
SETTINGS['MIDDLEWARE_CLASSES'] = SETTINGS['MIDDLEWARE']

# Build database settings
DATABASE = {
MEMORY_DATABASE = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
DATABASE['TEST'] = DATABASE.copy()
DATABASE = MEMORY_DATABASE.copy()
GDPR_DATABASE = MEMORY_DATABASE.copy()

DATABASE['TEST'] = MEMORY_DATABASE.copy()
GDPR_DATABASE['TEST'] = MEMORY_DATABASE.copy()

engine = os.environ.get('DATABASE_ENGINE')
if engine:
if engine == "pgsql":
Expand All @@ -72,13 +77,10 @@ def runtests(args):
DATABASE['ENGINE'] = 'django.db.backends.mysql'

# Make sure test DB is going to be UTF8
DATABASE_TEST = {
'TEST': {
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci',
}
DATABASE['TEST'] = {
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci',
}
DATABASE.update(DATABASE_TEST)

else:
raise ValueError("Unknown database engine")
Expand All @@ -89,7 +91,7 @@ def runtests(args):
DATABASE[key] = os.environ['DATABASE_' + key]
SETTINGS['DATABASES'] = {
'default': DATABASE,
'gdpr_log': DATABASE,
'gdpr_log': GDPR_DATABASE,
}
SETTINGS['DATABASE_ROUTERS'] = ['gdpr_assist.routers.EventLogRouter']

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ deps =
freezegun
pillow
psycopg2>2.4.1
#mysqlclient>=1.3.3
mysqlclient>=1.3.3
coverage>=4.0
coveralls>=1.0

Expand Down

0 comments on commit 3f0c527

Please sign in to comment.