Skip to content
Snippets Groups Projects
Verified Commit a4897193 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

test: add test for no pending migrations

parent df556c7c
No related branches found
No related tags found
No related merge requests found
import pytest
from django.core.management import call_command
pytestmark = pytest.mark.django_db
# adapted from https://adamj.eu/tech/2024/06/23/django-test-pending-migrations/ for pytest
def test_no_pending_migrations(capsys):
try:
call_command("makemigrations", "--dry-run", "--check")
except SystemExit: # pragma: no cover
out, _ = capsys.readouterr()
raise AssertionError("Pending migrations:\n" + out) from None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment