Last active
June 7, 2019 12:41
-
-
Save jarshwah/a3b3dfc0f7bc420b91971386a25837b1 to your computer and use it in GitHub Desktop.
Unit test for confirming there are no outstanding migrations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management import call_command | |
from django.test import TestCase | |
class MigrationsTestCase(TestCase): | |
def test_no_outstanding_migrations(self): | |
"""No migrations need to be generated""" | |
try: | |
result = call_command("makemigrations", "--dry-run", "--check", "--no-input", "-v", "0") | |
except SystemExit: | |
self.fail("There were outstanding migrations") | |
self.assertIsNone(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment