migrations.py 454 B

1234567891011121314151617
  1. # code snippet copied from https://gist.github.com/NotSqrt/5f3c76cd15e40ef62d09
  2. from pytest_django.lazy_django import get_django_version
  3. class DisableMigrations(object):
  4. def __init__(self):
  5. self._django_version = get_django_version()
  6. def __contains__(self, item):
  7. return True
  8. def __getitem__(self, item):
  9. if self._django_version >= (1, 9):
  10. return None
  11. else:
  12. return 'notmigrations'