Skip to content

Instantly share code, notes, and snippets.

View janlis-ff's full-sized avatar

Jan Lis janlis-ff

View GitHub Profile
@janlis-ff
janlis-ff / test__migrations.py
Created December 20, 2023 14:11
A pytest script for Django projects, ensuring all model changes are captured in migrations by failing the test if any migrations are missing.
from io import StringIO
import pytest
from django.core.management import call_command
@pytest.mark.django_db
class TestMissingMigrations:
error_message = (
"\n\tMissing migrations detected. Please "