-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Tests for migrations, especially potentially risky data migrations. | ||
""" | ||
from io import StringIO | ||
|
||
from django.core.management import call_command | ||
from django.test.testcases import TestCase | ||
from django.test.utils import override_settings | ||
|
||
|
||
class MigrationTests(TestCase): | ||
""" | ||
Runs migration tests using Django Command interface. | ||
""" | ||
|
||
@override_settings(MIGRATION_MODULES={}) | ||
def test_migrations_are_in_sync(self): | ||
out = StringIO() | ||
call_command("makemigrations", dry_run=True, verbosity=3, stdout=out) | ||
output = out.getvalue() | ||
self.assertIn("No changes detected", output) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,6 @@ | |
} | ||
}, | ||
] | ||
|
||
# disable indexing on date field via django-simple-history. | ||
SIMPLE_HISTORY_DATE_INDEX = False |