From 26ed4ecf628c2d5c17f8deb0cf2c9cab9b7fec3c Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Fri, 26 Apr 2019 22:28:17 +0200 Subject: [PATCH] Tests: add test project * manage.py file at the root of the project * targetting the project located at tests/test_project/settings.py That allows testing the linter through just calling it on the project itself. Using the new method coming soon: `python manage.py lintmigrations` --- manage.py | 10 ++ tests/test_project/__init__.py | 0 .../app_add_not_null_column/__init__.py | 0 .../app_add_not_null_column/admin.py | 3 + .../app_add_not_null_column/apps.py | 5 + .../migrations/0001_create_table.py | 28 ++++ .../migrations/0002_add_new_not_null_field.py | 17 +++ .../migrations/__init__.py | 0 .../app_add_not_null_column/models.py | 6 + .../app_add_not_null_column/tests.py | 3 + .../app_add_not_null_column/views.py | 3 + .../__init__.py | 0 .../admin.py | 6 + .../apps.py | 8 + .../migrations/0001_initial.py | 30 ++++ .../migrations/0002_a_not_null_field.py | 19 +++ .../migrations/__init__.py | 0 .../models.py | 9 ++ .../tests.py | 6 + .../views.py | 6 + .../test_project/app_alter_column/__init__.py | 0 tests/test_project/app_alter_column/admin.py | 6 + tests/test_project/app_alter_column/apps.py | 8 + .../migrations/0001_initial.py | 30 ++++ .../migrations/0002_auto_20190414_1456.py | 18 +++ .../app_alter_column/migrations/__init__.py | 0 tests/test_project/app_alter_column/models.py | 8 + tests/test_project/app_alter_column/tests.py | 6 + tests/test_project/app_alter_column/views.py | 6 + tests/test_project/app_correct/__init__.py | 0 tests/test_project/app_correct/admin.py | 3 + tests/test_project/app_correct/apps.py | 5 + .../app_correct/migrations/0001_initial.py | 28 ++++ .../app_correct/migrations/0002_foo.py | 14 ++ .../app_correct/migrations/__init__.py | 0 tests/test_project/app_correct/models.py | 6 + tests/test_project/app_correct/tests.py | 3 + tests/test_project/app_correct/views.py | 3 + .../__init__.py | 0 .../admin.py | 6 + .../apps.py | 8 + .../migrations/0001_initial.py | 30 ++++ .../migrations/__init__.py | 0 .../models.py | 8 + .../tests.py | 6 + .../views.py | 6 + .../test_project/app_drop_column/__init__.py | 0 tests/test_project/app_drop_column/admin.py | 6 + tests/test_project/app_drop_column/apps.py | 8 + .../migrations/0001_initial.py | 31 ++++ .../migrations/0002_remove_a_field_b.py | 12 ++ .../app_drop_column/migrations/__init__.py | 0 tests/test_project/app_drop_column/models.py | 8 + tests/test_project/app_drop_column/tests.py | 6 + tests/test_project/app_drop_column/views.py | 6 + .../app_ignore_migration/__init__.py | 0 .../app_ignore_migration/admin.py | 3 + .../test_project/app_ignore_migration/apps.py | 5 + .../migrations/0001_initial.py | 28 ++++ .../migrations/0002_ignore_migration.py | 20 +++ .../migrations/__init__.py | 0 .../app_ignore_migration/models.py | 6 + .../app_ignore_migration/tests.py | 3 + .../app_ignore_migration/views.py | 3 + .../app_rename_column/__init__.py | 0 tests/test_project/app_rename_column/admin.py | 6 + tests/test_project/app_rename_column/apps.py | 8 + .../migrations/0001_initial.py | 30 ++++ .../migrations/0002_auto_20190414_1502.py | 14 ++ .../app_rename_column/migrations/__init__.py | 0 .../test_project/app_rename_column/models.py | 8 + tests/test_project/app_rename_column/tests.py | 6 + tests/test_project/app_rename_column/views.py | 6 + .../test_project/app_rename_table/__init__.py | 0 tests/test_project/app_rename_table/admin.py | 6 + tests/test_project/app_rename_table/apps.py | 8 + .../migrations/0001_initial.py | 30 ++++ .../migrations/0002_auto_20190414_1500.py | 12 ++ .../app_rename_table/migrations/__init__.py | 0 tests/test_project/app_rename_table/models.py | 8 + tests/test_project/app_rename_table/tests.py | 6 + tests/test_project/app_rename_table/views.py | 6 + tests/test_project/settings.py | 142 ++++++++++++++++++ tests/test_project/urls.py | 19 +++ tests/test_project/wsgi.py | 16 ++ 85 files changed, 843 insertions(+) create mode 100755 manage.py create mode 100644 tests/test_project/__init__.py create mode 100644 tests/test_project/app_add_not_null_column/__init__.py create mode 100644 tests/test_project/app_add_not_null_column/admin.py create mode 100644 tests/test_project/app_add_not_null_column/apps.py create mode 100644 tests/test_project/app_add_not_null_column/migrations/0001_create_table.py create mode 100644 tests/test_project/app_add_not_null_column/migrations/0002_add_new_not_null_field.py create mode 100644 tests/test_project/app_add_not_null_column/migrations/__init__.py create mode 100644 tests/test_project/app_add_not_null_column/models.py create mode 100644 tests/test_project/app_add_not_null_column/tests.py create mode 100644 tests/test_project/app_add_not_null_column/views.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/__init__.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/admin.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/apps.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/migrations/0001_initial.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/migrations/0002_a_not_null_field.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/migrations/__init__.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/models.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/tests.py create mode 100644 tests/test_project/app_add_not_null_column_followed_by_default/views.py create mode 100644 tests/test_project/app_alter_column/__init__.py create mode 100644 tests/test_project/app_alter_column/admin.py create mode 100644 tests/test_project/app_alter_column/apps.py create mode 100644 tests/test_project/app_alter_column/migrations/0001_initial.py create mode 100644 tests/test_project/app_alter_column/migrations/0002_auto_20190414_1456.py create mode 100644 tests/test_project/app_alter_column/migrations/__init__.py create mode 100644 tests/test_project/app_alter_column/models.py create mode 100644 tests/test_project/app_alter_column/tests.py create mode 100644 tests/test_project/app_alter_column/views.py create mode 100644 tests/test_project/app_correct/__init__.py create mode 100644 tests/test_project/app_correct/admin.py create mode 100644 tests/test_project/app_correct/apps.py create mode 100644 tests/test_project/app_correct/migrations/0001_initial.py create mode 100644 tests/test_project/app_correct/migrations/0002_foo.py create mode 100644 tests/test_project/app_correct/migrations/__init__.py create mode 100644 tests/test_project/app_correct/models.py create mode 100644 tests/test_project/app_correct/tests.py create mode 100644 tests/test_project/app_correct/views.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/__init__.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/admin.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/apps.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/migrations/0001_initial.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/migrations/__init__.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/models.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/tests.py create mode 100644 tests/test_project/app_create_table_with_not_null_column/views.py create mode 100644 tests/test_project/app_drop_column/__init__.py create mode 100644 tests/test_project/app_drop_column/admin.py create mode 100644 tests/test_project/app_drop_column/apps.py create mode 100644 tests/test_project/app_drop_column/migrations/0001_initial.py create mode 100644 tests/test_project/app_drop_column/migrations/0002_remove_a_field_b.py create mode 100644 tests/test_project/app_drop_column/migrations/__init__.py create mode 100644 tests/test_project/app_drop_column/models.py create mode 100644 tests/test_project/app_drop_column/tests.py create mode 100644 tests/test_project/app_drop_column/views.py create mode 100644 tests/test_project/app_ignore_migration/__init__.py create mode 100644 tests/test_project/app_ignore_migration/admin.py create mode 100644 tests/test_project/app_ignore_migration/apps.py create mode 100644 tests/test_project/app_ignore_migration/migrations/0001_initial.py create mode 100644 tests/test_project/app_ignore_migration/migrations/0002_ignore_migration.py create mode 100644 tests/test_project/app_ignore_migration/migrations/__init__.py create mode 100644 tests/test_project/app_ignore_migration/models.py create mode 100644 tests/test_project/app_ignore_migration/tests.py create mode 100644 tests/test_project/app_ignore_migration/views.py create mode 100644 tests/test_project/app_rename_column/__init__.py create mode 100644 tests/test_project/app_rename_column/admin.py create mode 100644 tests/test_project/app_rename_column/apps.py create mode 100644 tests/test_project/app_rename_column/migrations/0001_initial.py create mode 100644 tests/test_project/app_rename_column/migrations/0002_auto_20190414_1502.py create mode 100644 tests/test_project/app_rename_column/migrations/__init__.py create mode 100644 tests/test_project/app_rename_column/models.py create mode 100644 tests/test_project/app_rename_column/tests.py create mode 100644 tests/test_project/app_rename_column/views.py create mode 100644 tests/test_project/app_rename_table/__init__.py create mode 100644 tests/test_project/app_rename_table/admin.py create mode 100644 tests/test_project/app_rename_table/apps.py create mode 100644 tests/test_project/app_rename_table/migrations/0001_initial.py create mode 100644 tests/test_project/app_rename_table/migrations/0002_auto_20190414_1500.py create mode 100644 tests/test_project/app_rename_table/migrations/__init__.py create mode 100644 tests/test_project/app_rename_table/models.py create mode 100644 tests/test_project/app_rename_table/tests.py create mode 100644 tests/test_project/app_rename_table/views.py create mode 100644 tests/test_project/settings.py create mode 100644 tests/test_project/urls.py create mode 100644 tests/test_project/wsgi.py diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..8512e65 --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.test_project.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/tests/test_project/__init__.py b/tests/test_project/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_add_not_null_column/__init__.py b/tests/test_project/app_add_not_null_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_add_not_null_column/admin.py b/tests/test_project/app_add_not_null_column/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project/app_add_not_null_column/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_add_not_null_column/apps.py b/tests/test_project/app_add_not_null_column/apps.py new file mode 100644 index 0000000..6445f32 --- /dev/null +++ b/tests/test_project/app_add_not_null_column/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AppAddNotNullColumnConfig(AppConfig): + name = "app_add_not_null_column" diff --git a/tests/test_project/app_add_not_null_column/migrations/0001_create_table.py b/tests/test_project/app_add_not_null_column/migrations/0001_create_table.py new file mode 100644 index 0000000..f790609 --- /dev/null +++ b/tests/test_project/app_add_not_null_column/migrations/0001_create_table.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1.4 on 2019-03-19 20:59 + +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", + ), + ), + ("null_field", models.IntegerField(null=True)), + ], + ) + ] diff --git a/tests/test_project/app_add_not_null_column/migrations/0002_add_new_not_null_field.py b/tests/test_project/app_add_not_null_column/migrations/0002_add_new_not_null_field.py new file mode 100644 index 0000000..e1cffb4 --- /dev/null +++ b/tests/test_project/app_add_not_null_column/migrations/0002_add_new_not_null_field.py @@ -0,0 +1,17 @@ +# Generated by Django 2.1.4 on 2019-03-19 21:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("app_add_not_null_column", "0001_create_table")] + + operations = [ + migrations.AddField( + model_name="a", + name="new_not_null_field", + field=models.IntegerField(default=1), + preserve_default=False, + ) + ] diff --git a/tests/test_project/app_add_not_null_column/migrations/__init__.py b/tests/test_project/app_add_not_null_column/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_add_not_null_column/models.py b/tests/test_project/app_add_not_null_column/models.py new file mode 100644 index 0000000..8bf59ee --- /dev/null +++ b/tests/test_project/app_add_not_null_column/models.py @@ -0,0 +1,6 @@ +from django.db import models + + +class A(models.Model): + null_field = models.IntegerField(null=True) + new_not_null_field = models.IntegerField(null=False) diff --git a/tests/test_project/app_add_not_null_column/tests.py b/tests/test_project/app_add_not_null_column/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project/app_add_not_null_column/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_add_not_null_column/views.py b/tests/test_project/app_add_not_null_column/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project/app_add_not_null_column/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/__init__.py b/tests/test_project/app_add_not_null_column_followed_by_default/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/admin.py b/tests/test_project/app_add_not_null_column_followed_by_default/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/apps.py b/tests/test_project/app_add_not_null_column_followed_by_default/apps.py new file mode 100644 index 0000000..bcf5180 --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppAddNotNullColumnFollowedByDefaultConfig(AppConfig): + name = "tests.test_project.app_add_not_null_column_followed_by_default" diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0001_initial.py b/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0001_initial.py new file mode 100644 index 0000000..6b7326b --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:54 +from __future__ import unicode_literals + +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", + ), + ), + ("field", models.IntegerField()), + ], + ) + ] diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0002_a_not_null_field.py b/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0002_a_not_null_field.py new file mode 100644 index 0000000..a978263 --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/migrations/0002_a_not_null_field.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:55 +from __future__ import unicode_literals + +from django.db import migrations, models + +from django_add_default_value import AddDefaultValue + + +class Migration(migrations.Migration): + + dependencies = [("app_add_not_null_column_followed_by_default", "0001_initial")] + + operations = [ + migrations.AddField( + model_name="a", name="not_null_field", field=models.IntegerField(default=1) + ), + AddDefaultValue(model_name="a", name="not_null_field", value=1), + ] diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/migrations/__init__.py b/tests/test_project/app_add_not_null_column_followed_by_default/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/models.py b/tests/test_project/app_add_not_null_column_followed_by_default/models.py new file mode 100644 index 0000000..9bf31bc --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/models.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class A(models.Model): + field = models.IntegerField() + not_null_field = models.IntegerField(null=False, default=1) diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/tests.py b/tests/test_project/app_add_not_null_column_followed_by_default/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_add_not_null_column_followed_by_default/views.py b/tests/test_project/app_add_not_null_column_followed_by_default/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_add_not_null_column_followed_by_default/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_alter_column/__init__.py b/tests/test_project/app_alter_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_alter_column/admin.py b/tests/test_project/app_alter_column/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_alter_column/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_alter_column/apps.py b/tests/test_project/app_alter_column/apps.py new file mode 100644 index 0000000..47b273d --- /dev/null +++ b/tests/test_project/app_alter_column/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppAlterColumnConfig(AppConfig): + name = "tests.test_project.app_alter_column" diff --git a/tests/test_project/app_alter_column/migrations/0001_initial.py b/tests/test_project/app_alter_column/migrations/0001_initial.py new file mode 100644 index 0000000..d709d39 --- /dev/null +++ b/tests/test_project/app_alter_column/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:56 +from __future__ import unicode_literals + +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", + ), + ), + ("field", models.IntegerField(null=True)), + ], + ) + ] diff --git a/tests/test_project/app_alter_column/migrations/0002_auto_20190414_1456.py b/tests/test_project/app_alter_column/migrations/0002_auto_20190414_1456.py new file mode 100644 index 0000000..2f2dc24 --- /dev/null +++ b/tests/test_project/app_alter_column/migrations/0002_auto_20190414_1456.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:56 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("app_alter_column", "0001_initial")] + + operations = [ + migrations.AlterField( + model_name="a", + name="field", + field=models.CharField(max_length=10, null=True), + ) + ] diff --git a/tests/test_project/app_alter_column/migrations/__init__.py b/tests/test_project/app_alter_column/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_alter_column/models.py b/tests/test_project/app_alter_column/models.py new file mode 100644 index 0000000..9432421 --- /dev/null +++ b/tests/test_project/app_alter_column/models.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class A(models.Model): + field = models.CharField(null=True, max_length=10) diff --git a/tests/test_project/app_alter_column/tests.py b/tests/test_project/app_alter_column/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_alter_column/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_alter_column/views.py b/tests/test_project/app_alter_column/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_alter_column/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_correct/__init__.py b/tests/test_project/app_correct/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_correct/admin.py b/tests/test_project/app_correct/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project/app_correct/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_correct/apps.py b/tests/test_project/app_correct/apps.py new file mode 100644 index 0000000..bac812d --- /dev/null +++ b/tests/test_project/app_correct/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AppCorrectConfig(AppConfig): + name = "app_correct" diff --git a/tests/test_project/app_correct/migrations/0001_initial.py b/tests/test_project/app_correct/migrations/0001_initial.py new file mode 100644 index 0000000..9ce2453 --- /dev/null +++ b/tests/test_project/app_correct/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1.4 on 2019-03-19 21:08 + +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", + ), + ), + ("null_field", models.IntegerField(null=True)), + ], + ) + ] diff --git a/tests/test_project/app_correct/migrations/0002_foo.py b/tests/test_project/app_correct/migrations/0002_foo.py new file mode 100644 index 0000000..0ccdf22 --- /dev/null +++ b/tests/test_project/app_correct/migrations/0002_foo.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1.4 on 2019-03-19 21:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("app_correct", "0001_initial")] + + operations = [ + migrations.AddField( + model_name="a", name="new_null_field", field=models.IntegerField(null=True) + ) + ] diff --git a/tests/test_project/app_correct/migrations/__init__.py b/tests/test_project/app_correct/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_correct/models.py b/tests/test_project/app_correct/models.py new file mode 100644 index 0000000..2382369 --- /dev/null +++ b/tests/test_project/app_correct/models.py @@ -0,0 +1,6 @@ +from django.db import models + + +class A(models.Model): + null_field = models.IntegerField(null=True) + new_null_field = models.IntegerField(null=True) diff --git a/tests/test_project/app_correct/tests.py b/tests/test_project/app_correct/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project/app_correct/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_correct/views.py b/tests/test_project/app_correct/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project/app_correct/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_create_table_with_not_null_column/__init__.py b/tests/test_project/app_create_table_with_not_null_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_create_table_with_not_null_column/admin.py b/tests/test_project/app_create_table_with_not_null_column/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_create_table_with_not_null_column/apps.py b/tests/test_project/app_create_table_with_not_null_column/apps.py new file mode 100644 index 0000000..af8d97e --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppCreateTableWithNotNullColumnConfig(AppConfig): + name = "tests.test_project.app_create_table_with_not_null_column" diff --git a/tests/test_project/app_create_table_with_not_null_column/migrations/0001_initial.py b/tests/test_project/app_create_table_with_not_null_column/migrations/0001_initial.py new file mode 100644 index 0000000..0eb92ac --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:59 +from __future__ import unicode_literals + +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", + ), + ), + ("field", models.CharField(max_length=150)), + ], + ) + ] diff --git a/tests/test_project/app_create_table_with_not_null_column/migrations/__init__.py b/tests/test_project/app_create_table_with_not_null_column/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_create_table_with_not_null_column/models.py b/tests/test_project/app_create_table_with_not_null_column/models.py new file mode 100644 index 0000000..aee4c79 --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/models.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class A(models.Model): + field = models.CharField(max_length=150, null=False) diff --git a/tests/test_project/app_create_table_with_not_null_column/tests.py b/tests/test_project/app_create_table_with_not_null_column/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_create_table_with_not_null_column/views.py b/tests/test_project/app_create_table_with_not_null_column/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_create_table_with_not_null_column/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_drop_column/__init__.py b/tests/test_project/app_drop_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_drop_column/admin.py b/tests/test_project/app_drop_column/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_drop_column/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_drop_column/apps.py b/tests/test_project/app_drop_column/apps.py new file mode 100644 index 0000000..157af6a --- /dev/null +++ b/tests/test_project/app_drop_column/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppDropColumnConfig(AppConfig): + name = "tests.test_project.app_drop_column" diff --git a/tests/test_project/app_drop_column/migrations/0001_initial.py b/tests/test_project/app_drop_column/migrations/0001_initial.py new file mode 100644 index 0000000..6e3755c --- /dev/null +++ b/tests/test_project/app_drop_column/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:59 +from __future__ import unicode_literals + +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", + ), + ), + ("field_a", models.IntegerField()), + ("field_b", models.CharField(max_length=10)), + ], + ) + ] diff --git a/tests/test_project/app_drop_column/migrations/0002_remove_a_field_b.py b/tests/test_project/app_drop_column/migrations/0002_remove_a_field_b.py new file mode 100644 index 0000000..a040984 --- /dev/null +++ b/tests/test_project/app_drop_column/migrations/0002_remove_a_field_b.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 14:59 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("app_drop_column", "0001_initial")] + + operations = [migrations.RemoveField(model_name="a", name="field_b")] diff --git a/tests/test_project/app_drop_column/migrations/__init__.py b/tests/test_project/app_drop_column/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_drop_column/models.py b/tests/test_project/app_drop_column/models.py new file mode 100644 index 0000000..3dfc12b --- /dev/null +++ b/tests/test_project/app_drop_column/models.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class A(models.Model): + field_a = models.IntegerField() diff --git a/tests/test_project/app_drop_column/tests.py b/tests/test_project/app_drop_column/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_drop_column/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_drop_column/views.py b/tests/test_project/app_drop_column/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_drop_column/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_ignore_migration/__init__.py b/tests/test_project/app_ignore_migration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_ignore_migration/admin.py b/tests/test_project/app_ignore_migration/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project/app_ignore_migration/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_ignore_migration/apps.py b/tests/test_project/app_ignore_migration/apps.py new file mode 100644 index 0000000..c12eb34 --- /dev/null +++ b/tests/test_project/app_ignore_migration/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AppIgnoreMigrationConfig(AppConfig): + name = "app_ignore_migration" diff --git a/tests/test_project/app_ignore_migration/migrations/0001_initial.py b/tests/test_project/app_ignore_migration/migrations/0001_initial.py new file mode 100644 index 0000000..d3dcbd7 --- /dev/null +++ b/tests/test_project/app_ignore_migration/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1.4 on 2019-03-21 20:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="B", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("null_field", models.IntegerField()), + ], + ) + ] diff --git a/tests/test_project/app_ignore_migration/migrations/0002_ignore_migration.py b/tests/test_project/app_ignore_migration/migrations/0002_ignore_migration.py new file mode 100644 index 0000000..11a37bf --- /dev/null +++ b/tests/test_project/app_ignore_migration/migrations/0002_ignore_migration.py @@ -0,0 +1,20 @@ +# Generated by Django 2.1.4 on 2019-03-21 20:41 + +from django.db import migrations, models + +import django_migration_linter as linter + + +class Migration(migrations.Migration): + + dependencies = [("app_ignore_migration", "0001_initial")] + + operations = [ + linter.IgnoreMigration(), + migrations.AddField( + model_name="b", + name="null_field_real", + field=models.IntegerField(default=1), + preserve_default=False, + ), + ] diff --git a/tests/test_project/app_ignore_migration/migrations/__init__.py b/tests/test_project/app_ignore_migration/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_ignore_migration/models.py b/tests/test_project/app_ignore_migration/models.py new file mode 100644 index 0000000..950aae0 --- /dev/null +++ b/tests/test_project/app_ignore_migration/models.py @@ -0,0 +1,6 @@ +from django.db import models + + +class B(models.Model): + null_field = models.IntegerField() + null_field_real = models.IntegerField(null=False) diff --git a/tests/test_project/app_ignore_migration/tests.py b/tests/test_project/app_ignore_migration/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project/app_ignore_migration/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_ignore_migration/views.py b/tests/test_project/app_ignore_migration/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project/app_ignore_migration/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_rename_column/__init__.py b/tests/test_project/app_rename_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_rename_column/admin.py b/tests/test_project/app_rename_column/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_rename_column/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_rename_column/apps.py b/tests/test_project/app_rename_column/apps.py new file mode 100644 index 0000000..5b453e4 --- /dev/null +++ b/tests/test_project/app_rename_column/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppRenameColumnConfig(AppConfig): + name = "tests.test_project.app_rename_column" diff --git a/tests/test_project/app_rename_column/migrations/0001_initial.py b/tests/test_project/app_rename_column/migrations/0001_initial.py new file mode 100644 index 0000000..c2f645f --- /dev/null +++ b/tests/test_project/app_rename_column/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 15:02 +from __future__ import unicode_literals + +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", + ), + ), + ("field", models.IntegerField()), + ], + ) + ] diff --git a/tests/test_project/app_rename_column/migrations/0002_auto_20190414_1502.py b/tests/test_project/app_rename_column/migrations/0002_auto_20190414_1502.py new file mode 100644 index 0000000..902a9f3 --- /dev/null +++ b/tests/test_project/app_rename_column/migrations/0002_auto_20190414_1502.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 15:02 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("app_rename_column", "0001_initial")] + + operations = [ + migrations.RenameField(model_name="a", old_name="field", new_name="renamed") + ] diff --git a/tests/test_project/app_rename_column/migrations/__init__.py b/tests/test_project/app_rename_column/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_rename_column/models.py b/tests/test_project/app_rename_column/models.py new file mode 100644 index 0000000..493b10e --- /dev/null +++ b/tests/test_project/app_rename_column/models.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class A(models.Model): + renamed = models.IntegerField() diff --git a/tests/test_project/app_rename_column/tests.py b/tests/test_project/app_rename_column/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_rename_column/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_rename_column/views.py b/tests/test_project/app_rename_column/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_rename_column/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/app_rename_table/__init__.py b/tests/test_project/app_rename_table/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_rename_table/admin.py b/tests/test_project/app_rename_table/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/tests/test_project/app_rename_table/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project/app_rename_table/apps.py b/tests/test_project/app_rename_table/apps.py new file mode 100644 index 0000000..f7b9024 --- /dev/null +++ b/tests/test_project/app_rename_table/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class AppRenameTableConfig(AppConfig): + name = "tests.test_project.app_rename_table" diff --git a/tests/test_project/app_rename_table/migrations/0001_initial.py b/tests/test_project/app_rename_table/migrations/0001_initial.py new file mode 100644 index 0000000..ea12d28 --- /dev/null +++ b/tests/test_project/app_rename_table/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 15:00 +from __future__ import unicode_literals + +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", + ), + ), + ("field", models.IntegerField()), + ], + ) + ] diff --git a/tests/test_project/app_rename_table/migrations/0002_auto_20190414_1500.py b/tests/test_project/app_rename_table/migrations/0002_auto_20190414_1500.py new file mode 100644 index 0000000..922899e --- /dev/null +++ b/tests/test_project/app_rename_table/migrations/0002_auto_20190414_1500.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-04-14 15:00 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("app_rename_table", "0001_initial")] + + operations = [migrations.RenameModel(old_name="A", new_name="B")] diff --git a/tests/test_project/app_rename_table/migrations/__init__.py b/tests/test_project/app_rename_table/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project/app_rename_table/models.py b/tests/test_project/app_rename_table/models.py new file mode 100644 index 0000000..76cfe6a --- /dev/null +++ b/tests/test_project/app_rename_table/models.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + + +class B(models.Model): + field = models.IntegerField() diff --git a/tests/test_project/app_rename_table/tests.py b/tests/test_project/app_rename_table/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/tests/test_project/app_rename_table/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project/app_rename_table/views.py b/tests/test_project/app_rename_table/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/tests/test_project/app_rename_table/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project/settings.py b/tests/test_project/settings.py new file mode 100644 index 0000000..3e8e501 --- /dev/null +++ b/tests/test_project/settings.py @@ -0,0 +1,142 @@ +""" +Django settings for test_project project. + +Generated by 'django-admin startproject' using Django 2.1.7. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +from collections import OrderedDict + +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = "dummy" + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "django_migration_linter", + "tests.test_project.app_add_not_null_column", + "tests.test_project.app_add_not_null_column_followed_by_default", + "tests.test_project.app_alter_column", + "tests.test_project.app_correct", + "tests.test_project.app_create_table_with_not_null_column", + "tests.test_project.app_drop_column", + "tests.test_project.app_ignore_migration", + "tests.test_project.app_rename_column", + "tests.test_project.app_rename_table", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "tests.test_project.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ] + }, + } +] + +WSGI_APPLICATION = "tests.test_project.wsgi.application" + + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": os.path.join(BASE_DIR, "db.sqlite3"), + "TEST": {"DEPENDENCIES": []}, + }, + "sqlite": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": "sqlite3", + "TEST": {"DEPENDENCIES": []}, + }, + "postgresql": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "django_migration_linter_test_project", + "USER": "postgres", + "TEST": {"DEPENDENCIES": []}, + }, + "mysql": { + "ENGINE": "django.db.backends.mysql", + "NAME": "django_migration_linter_test_project", + "USER": "travis", + "PASSWORD": "", + "HOST": "127.0.0.1", + "TEST": {"DEPENDENCIES": []}, + }, +} + + +# Password validation + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" + }, + {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, + {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, + {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.1/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = "/static/" diff --git a/tests/test_project/urls.py b/tests/test_project/urls.py new file mode 100644 index 0000000..71e4b48 --- /dev/null +++ b/tests/test_project/urls.py @@ -0,0 +1,19 @@ +"""test_project URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.conf.urls import url + +urlpatterns = [url("admin/", admin.site.urls)] diff --git a/tests/test_project/wsgi.py b/tests/test_project/wsgi.py new file mode 100644 index 0000000..9c142be --- /dev/null +++ b/tests/test_project/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for test_project project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") + +application = get_wsgi_application()