Skip to content

Commit f90b46d

Browse files
authored
Fixed #1562 -- Added test for pending migrations
1 parent 4a0da9a commit f90b46d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

djangoproject/tests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from http import HTTPStatus
2+
from io import StringIO
23

4+
from django.core.management import call_command
35
from django.test import TestCase
46
from django_hosts.resolvers import reverse
57

@@ -114,3 +116,17 @@ def test_www_host_with_port(self):
114116
self.assertEqual(resp.status_code, HTTPStatus.OK)
115117
self.assertIn("Content-Language", resp)
116118
self.assertIn("Vary", resp)
119+
120+
121+
class PendingMigrationsTests(TestCase):
122+
def test_no_pending_migrations(self):
123+
out = StringIO()
124+
try:
125+
call_command(
126+
"makemigrations",
127+
"--check",
128+
stdout=out,
129+
stderr=StringIO(),
130+
)
131+
except SystemExit: # pragma: no cover
132+
raise AssertionError("Pending migrations:\n" + out.getvalue()) from None

0 commit comments

Comments
 (0)