kopia lustrzana https://github.com/jedie/PyInventory
Add test for missing migrations
rodzic
095913a028
commit
ccba5c09e4
|
@ -0,0 +1,24 @@
|
||||||
|
import io
|
||||||
|
|
||||||
|
from django.core import management
|
||||||
|
from django.core.management.commands import makemigrations
|
||||||
|
from django.test import TestCase, override_settings
|
||||||
|
|
||||||
|
|
||||||
|
class TestMigrations(TestCase):
|
||||||
|
databases = ['default', ]
|
||||||
|
|
||||||
|
@override_settings(MIGRATION_MODULES={})
|
||||||
|
def test_missing_migrations(self):
|
||||||
|
output = io.StringIO()
|
||||||
|
try:
|
||||||
|
management.call_command(
|
||||||
|
makemigrations.Command(),
|
||||||
|
dry_run=True,
|
||||||
|
check_changes=True,
|
||||||
|
verbosity=1,
|
||||||
|
stdout=output
|
||||||
|
)
|
||||||
|
except SystemExit as err:
|
||||||
|
if err.code != 0:
|
||||||
|
raise AssertionError(output.getvalue())
|
Ładowanie…
Reference in New Issue