Skip to content

Commit

Permalink
Fixed #1562 -- Added test for pending migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakshya272 committed Jul 1, 2024
1 parent 4a0da9a commit f90b46d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions djangoproject/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from http import HTTPStatus
from io import StringIO

from django.core.management import call_command
from django.test import TestCase
from django_hosts.resolvers import reverse

Expand Down Expand Up @@ -114,3 +116,17 @@ def test_www_host_with_port(self):
self.assertEqual(resp.status_code, HTTPStatus.OK)
self.assertIn("Content-Language", resp)
self.assertIn("Vary", resp)


class PendingMigrationsTests(TestCase):
def test_no_pending_migrations(self):
out = StringIO()
try:
call_command(
"makemigrations",
"--check",
stdout=out,
stderr=StringIO(),
)
except SystemExit: # pragma: no cover
raise AssertionError("Pending migrations:\n" + out.getvalue()) from None

0 comments on commit f90b46d

Please sign in to comment.