Skip to content

Instantly share code, notes, and snippets.

@kezabelle
Created March 10, 2017 15:40
Show Gist options
  • Save kezabelle/bb66e203f9f55b749b739ec4be77ac97 to your computer and use it in GitHub Desktop.
Save kezabelle/bb66e203f9f55b749b739ec4be77ac97 to your computer and use it in GitHub Desktop.
go away migrations during a pytest run. For my own recollection, but also for w0rp in #django IRC.
# https://simpleisbetterthancomplex.com/tips/2016/08/19/django-tip-12-disabling-migrations-to-speed-up-unit-tests.html
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return 'notmigrations'
MIGRATION_MODULES = DisableMigrations()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment