Add app for unique together testing
This commit is contained in:
1 parent
00826d399a
commit
8aac58abbe
12 files changed
+78
No files matched your search
@@ -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"
|
||||
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AppUniqueTogetherConfig(AppConfig):
|
||||
name = "app_unique_together"
|
||||
@@ -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)),
|
||||
],
|
||||
)
|
||||
]
|
||||
@@ -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")}
|
||||
)
|
||||
]
|
||||
@@ -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())]
|
||||
Whitespace-only changes.
@@ -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"),)
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user