Skip to content

Commit

Permalink
Use nomigrations from pytest-django.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblayman committed Jul 9, 2020
1 parent df49496 commit ce5a65c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ graph:
-o models.png

coverage:
coverage run --source='homeschool' -m pytest
coverage run --source='homeschool' -m pytest --migrations
coverage report

mypy:
Expand Down
12 changes: 0 additions & 12 deletions project/testing_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}


# Migrations are slow to run for tests. Disable them.
class DisableMigrations(object):
def __contains__(self, item):
return True

def __getitem__(self, item):
return None


MIGRATION_MODULES = DisableMigrations()


# The password hasher is deliberately slow on the real site. Use a dumb and fast one.
class SimplePasswordHasher(BasePasswordHasher):
"""A simple hasher inspired by django-plainpasswordhasher"""
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[pytest]
addopts =
--nomigrations
DJANGO_SETTINGS_MODULE = project.testing_settings
filterwarnings =
# This warning is coming from django-allauth 0.41.0.
Expand Down

0 comments on commit ce5a65c

Please sign in to comment.