From 16db42e2ea4eab104927b313a4263ffe483cd9f9 Mon Sep 17 00:00:00 2001 From: Raphael Gaschignard Date: Mon, 24 Jul 2023 14:10:41 +0900 Subject: [PATCH] Add migration files for tests --- ...tancelazyresolutionfoodtag_tag_and_more.py | 173 ++++++++++++++++++ tests/tests.py | 5 + 2 files changed, 178 insertions(+) create mode 100644 tests/migrations/0007_alter_multiinheritancelazyresolutionfoodtag_tag_and_more.py diff --git a/tests/migrations/0007_alter_multiinheritancelazyresolutionfoodtag_tag_and_more.py b/tests/migrations/0007_alter_multiinheritancelazyresolutionfoodtag_tag_and_more.py new file mode 100644 index 00000000..0f039d07 --- /dev/null +++ b/tests/migrations/0007_alter_multiinheritancelazyresolutionfoodtag_tag_and_more.py @@ -0,0 +1,173 @@ +# Generated by Django 4.2 on 2023-07-24 00:05 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("contenttypes", "0002_remove_content_type_name"), + ("taggit", "0005_auto_20220424_2025"), + ("tests", "0006_auto_20230622_0834"), + ] + + operations = [ + migrations.AlterField( + model_name="multiinheritancelazyresolutionfoodtag", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="officialthroughmodel", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_tagged_items", + to="contenttypes.contenttype", + verbose_name="content type", + ), + ), + migrations.AlterField( + model_name="taggedcustompk", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_tagged_items", + to="contenttypes.contenttype", + verbose_name="content type", + ), + ), + migrations.AlterField( + model_name="taggedcustompk", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedcustompkfood", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedcustompkpet", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedfood", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedpet", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedtrackedfood", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_items", + to="tests.trackedtag", + ), + ), + migrations.AlterField( + model_name="taggedtrackedpet", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_items", + to="tests.trackedtag", + ), + ), + migrations.AlterField( + model_name="tenanttaggeditem", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_tagged_items", + to="contenttypes.contenttype", + verbose_name="content type", + ), + ), + migrations.AlterField( + model_name="tenanttaggeditem", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="tests.tenanttag", + ), + ), + migrations.AlterField( + model_name="through1", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="through2", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="throughgfk", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_tagged_items", + to="contenttypes.contenttype", + verbose_name="content type", + ), + ), + migrations.AlterField( + model_name="uuidtaggeditem", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_tagged_items", + to="contenttypes.contenttype", + verbose_name="content type", + ), + ), + migrations.AlterField( + model_name="uuidtaggeditem", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="tests.uuidtag", + ), + ), + ] diff --git a/tests/tests.py b/tests/tests.py index 166ddfcd..4b837fc5 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1362,3 +1362,8 @@ def test_taggit_has_no_pending_migrations(self): out = StringIO() call_command("makemigrations", "taggit", dry_run=True, stdout=out) self.assertEqual(out.getvalue().strip(), "No changes detected in app 'taggit'") + + def test_tests_have_no_pending_migrations(self): + out = StringIO() + call_command("makemigrations", "tests", dry_run=True, stdout=out) + self.assertEqual(out.getvalue().strip(), "No changes detected in app 'tests'")