Skip to content

Commit

Permalink
Create migration file after change in .inviter
Browse files Browse the repository at this point in the history
This is required because of the change introduced in this commit:

4235da2

Also, create a test to ensure that future commits don't forget to create
any necessary migration files.
  • Loading branch information
Flimm committed Jun 13, 2024
1 parent f52c37c commit 8ae641f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
29 changes: 29 additions & 0 deletions invitations/migrations/0005_alter_invitation_inviter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.2.13 on 2024-06-13 12:44

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("invitations", "0004_auto_20230328_1430"),
]

operations = [
migrations.AlterField(
model_name="invitation",
name="inviter",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(app_label)s_%(class)ss",
related_query_name="%(app_label)s_%(class)s",
to=settings.AUTH_USER_MODEL,
verbose_name="inviter",
),
),
]
13 changes: 13 additions & 0 deletions tests/test_migrations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
from django.core.management import call_command


class TestMigrations:
@pytest.mark.django_db
def test_all_necessary_migrations_created(self):
try:
call_command("makemigrations", "--check", "--dry-run")
all_necessary_migrations_created = True
except SystemExit:
all_necessary_migrations_created = False
assert all_necessary_migrations_created

0 comments on commit 8ae641f

Please sign in to comment.