Skip to content

Commit 3d35c4f

Browse files
committed
Tweaked sqlitetest config to avoid a minutes-long stepping through migrations for each test run.
- Legacy-Id: 9245
1 parent a5a5659 commit 3d35c4f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

ietf/settings_sqlitetest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66

77
from settings import * # pyflakes:ignore
88

9+
# Workaround to avoid spending minutes stepping through the migrations in
10+
# every test run. The result of this is to use the 'syncdb' way of creating
11+
# the test database instead of doing it through the migrations. Taken from
12+
# https://gist.github.com/NotSqrt/5f3c76cd15e40ef62d09
13+
14+
## To be removed after upgrade to Django 1.8 ##
15+
16+
class DisableMigrations(object):
17+
18+
def __contains__(self, item):
19+
return True
20+
21+
def __getitem__(self, item):
22+
return None
23+
24+
MIGRATION_MODULES = DisableMigrations()
25+
926
DATABASES = {
1027
'default': {
1128
'NAME': 'test.db',

0 commit comments

Comments
 (0)