Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for pending migrations #68

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions svjis/articles/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from io import StringIO
from django.core.management import call_command
from django.test import TestCase
from django.urls import reverse

Expand Down Expand Up @@ -290,3 +292,17 @@ def test_send_article_notifications(self):
self.assertEqual(res_recipients[0].last_name, 'Beran')
self.assertEqual(res_recipients[1].last_name, 'Brambůrek')
self.assertEqual(res_recipients[2].last_name, 'Nebus')


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