Skip to content

Commit 18ee46a

Browse files
committed
fix(controller): allow multiple unit tests with random db name
1 parent c9eb523 commit 18ee46a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

controller/deis/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from __future__ import unicode_literals
66
import os.path
7+
import random
8+
import string
79
import sys
810
import tempfile
911

@@ -303,6 +305,9 @@
303305
'default': {
304306
'ENGINE': 'django.db.backends.' + os.environ.get('DATABASE_ENGINE', 'postgresql_psycopg2'),
305307
'NAME': os.environ.get('DATABASE_NAME', 'deis'),
308+
# randomize test database name so we can run multiple unit tests simultaneously
309+
'TEST_NAME': "unittest-{}".format(''.join(
310+
random.choice(string.ascii_letters + string.digits) for _ in range(8)))
306311
}
307312
}
308313

0 commit comments

Comments
 (0)