File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
from http import HTTPStatus
2
+ from io import StringIO
2
3
4
+ from django .core .management import call_command
3
5
from django .test import TestCase
4
6
from django_hosts .resolvers import reverse
5
7
@@ -114,3 +116,17 @@ def test_www_host_with_port(self):
114
116
self .assertEqual (resp .status_code , HTTPStatus .OK )
115
117
self .assertIn ("Content-Language" , resp )
116
118
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
You can’t perform that action at this time.
0 commit comments