diff --git a/tests/fixtures.py b/tests/fixtures.py index c65d8f4..1978bcc 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -22,3 +22,4 @@ IGNORE_MIGRATION = "app_ignore_migration" ADD_NOT_NULL_COLUMN_FOLLOWED_BY_DEFAULT = "app_add_not_null_column_followed_by_default" ALTER_COLUMN = "app_alter_column" ALTER_COLUMN_DROP_NOT_NULL = "app_alter_column_drop_not_null" +DROP_UNIQUE_TOGETHER = "app_unique_together" diff --git a/tests/test_project/app_unique_together/__init__.py b/tests/test_project/app_unique_together/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_unique_together/admin.py b/tests/test_project/app_unique_together/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project/app_unique_together/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_unique_together/apps.py b/tests/test_project/app_unique_together/apps.py new file mode 100644 index 0000000..8ee1520 --- /dev/null +++ b/tests/test_project/app_unique_together/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AppUniqueTogetherConfig(AppConfig): + name = "app_unique_together" diff --git a/tests/test_project/app_unique_together/migrations/0001_initial.py b/tests/test_project/app_unique_together/migrations/0001_initial.py new file mode 100644 index 0000000..68c5d91 --- /dev/null +++ b/tests/test_project/app_unique_together/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# Generated by Django 2.2 on 2019-07-29 21:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="A", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("int_field", models.IntegerField()), + ("char_field", models.CharField(max_length=255)), + ], + ) + ] diff --git a/tests/test_project/app_unique_together/migrations/0002_auto_20190729_2122.py b/tests/test_project/app_unique_together/migrations/0002_auto_20190729_2122.py new file mode 100644 index 0000000..0786991 --- /dev/null +++ b/tests/test_project/app_unique_together/migrations/0002_auto_20190729_2122.py @@ -0,0 +1,14 @@ +# Generated by Django 2.2 on 2019-07-29 21:22 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("app_unique_together", "0001_initial")] + + operations = [ + migrations.AlterUniqueTogether( + name="a", unique_together={("int_field", "char_field")} + ) + ] diff --git a/tests/test_project/app_unique_together/migrations/0003_auto_20190729_2122.py b/tests/test_project/app_unique_together/migrations/0003_auto_20190729_2122.py new file mode 100644 index 0000000..e9307f2 --- /dev/null +++ b/tests/test_project/app_unique_together/migrations/0003_auto_20190729_2122.py @@ -0,0 +1,10 @@ +# Generated by Django 2.2 on 2019-07-29 21:22 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("app_unique_together", "0002_auto_20190729_2122")] + + operations = [migrations.AlterUniqueTogether(name="a", unique_together=set())] diff --git a/tests/test_project/app_unique_together/migrations/__init__.py b/tests/test_project/app_unique_together/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_unique_together/models.py b/tests/test_project/app_unique_together/models.py new file mode 100644 index 0000000..917cb06 --- /dev/null +++ b/tests/test_project/app_unique_together/models.py @@ -0,0 +1,9 @@ +from django.db import models + + +class A(models.Model): + int_field = models.IntegerField() + char_field = models.CharField(max_length=255) + + # class Meta: + # unique_together = (("int_field", "char_field"),) diff --git a/tests/test_project/app_unique_together/tests.py b/tests/test_project/app_unique_together/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project/app_unique_together/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_unique_together/views.py b/tests/test_project/app_unique_together/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project/app_unique_together/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/settings.py b/tests/test_project/settings.py index 723bbef..89c66fb 100644 --- a/tests/test_project/settings.py +++ b/tests/test_project/settings.py @@ -51,6 +51,7 @@ INSTALLED_APPS = [ "tests.test_project.app_ignore_migration", "tests.test_project.app_rename_column", "tests.test_project.app_rename_table", + "tests.test_project.app_unique_together", ] MIDDLEWARE = [