add testcase: drop table

This commit is contained in:
Viktor Danyliuk authored and David Wobrock committed 2019-07-29 23:14:30 +02:00
1 parent fc7a81e719
commit b79f9794ec
9 files changed
+68

No files matched your search

+1
View File
@@ -15,6 +15,7 @@
CREATE_TABLE_WITH_NOT_NULL_COLUMN = "app_create_table_with_not_null_column"
ADD_NOT_NULL_COLUMN = "app_add_not_null_column"
DROP_COLUMN = "app_drop_column"
DROP_TABLE = "app_drop_table"
RENAME_COLUMN = "app_rename_column"
RENAME_TABLE = "app_rename_table"
IGNORE_MIGRATION = "app_ignore_migration"
@@ -61,6 +61,10 @@ class BaseBackwardCompatibilityDetection(object):
app = fixtures.DROP_COLUMN
self._test_linter_finds_errors(app)
def test_detect_drop_table(self):
app = fixtures.DROP_TABLE
self._test_linter_finds_errors(app)
def test_detect_rename_column(self):
app = fixtures.RENAME_COLUMN
self._test_linter_finds_errors(app)
Whitespace-only changes.
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AppDropTableConfig(AppConfig):
name = "tests.test_project.app_drop_table"
@@ -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_a", models.IntegerField()),
],
)
]
@@ -0,0 +1,16 @@
# Generated by Django 2.1.10 on 2019-07-19 09:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app_drop_table', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='A',
),
]
Whitespace-only changes.
@@ -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()
+1
View File
@@ -47,6 +47,7 @@ INSTALLED_APPS = [
"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_drop_table",
"tests.test_project.app_ignore_migration",
"tests.test_project.app_rename_column",
"tests.test_project.app_rename_table",