tests: don't run migrations if environment has DISABLE_MIGRATIONS (#12889)

This commit is contained in:
Frédéric Péters 2016-08-20 18:48:13 +02:00
parent c0f49ca21b
commit ab4a5cdb10
1 changed files with 10 additions and 0 deletions

View File

@ -22,3 +22,13 @@ TEMPLATE_VARS = {}
import tempfile
MEDIA_ROOT = tempfile.mkdtemp('combo-test')
if 'DISABLE_MIGRATIONS' in os.environ:
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return 'notmigrations'
MIGRATION_MODULES = DisableMigrations()