Skip to content

Commit

Permalink
chore: fixing new migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Jul 27, 2023
1 parent 816177f commit d49b681
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions organizations/tests/test_migrations.py
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)
3 changes: 3 additions & 0 deletions test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
}
},
]

# disable indexing on date field via django-simple-history.
SIMPLE_HISTORY_DATE_INDEX = False

0 comments on commit d49b681

Please sign in to comment.