django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 939 forks source link

Add a test to check that there are no pending migrations #1562

Open bmispelon opened 3 days ago

bmispelon commented 3 days ago

We use django-upgrade (with pre-commit) and its author has recommended having a test for pending migrations: https://mastodon.social/@adamchainz@fosstodon.org/112687118840974800

This is to ensure that code modifications by django-upgrade don't result in forgotten migrations.

Adam has a blog post about how do do that (see the link above) so this should be a good first-time contribution if anyone is tempted. I would place the test in djangoproject/tests.py since it's not tied to a specific app.