summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-03-08 16:04:21 -0800
committerAndrew Godwin <andrew@aeracode.org>2014-03-08 16:04:21 -0800
commitabccbcf52da4a0f0c388b8a770b5de04d6d6e64c (patch)
tree6b3231f0fcf2cf02ef3c31068e62889ee453e924 /tests
parent6b078044745ee3c665051a886021c6fd1f6873b6 (diff)
Fixed #21843: Remove explicit ID column setting in test
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_operations.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index 99f388225a..86cfaf546b 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -132,7 +132,7 @@ class OperationTests(MigrationTestBase):
operation.database_forwards("test_crmomm", editor, project_state, new_state)
self.assertTableExists("test_crmomm_stable")
self.assertTableExists("test_crmomm_stable_ponies")
- self.assertColumnNotExists("test_crmomm", "ponies")
+ self.assertColumnNotExists("test_crmomm_stable", "ponies")
# Make sure the M2M field actually works
with atomic():
new_apps = new_state.render()
@@ -479,22 +479,22 @@ class OperationTests(MigrationTestBase):
self.assertEqual(len(new_state.models["test_alunto", "pony"].options.get("unique_together", set())), 1)
# Make sure we can insert duplicate rows
with connection.cursor() as cursor:
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (1, 1, 1)")
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (2, 1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
cursor.execute("DELETE FROM test_alunto_pony")
# Test the database alteration
with connection.schema_editor() as editor:
operation.database_forwards("test_alunto", editor, project_state, new_state)
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (1, 1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
with self.assertRaises(IntegrityError):
with atomic():
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (2, 1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
cursor.execute("DELETE FROM test_alunto_pony")
# And test reversal
with connection.schema_editor() as editor:
operation.database_backwards("test_alunto", editor, new_state, project_state)
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (1, 1, 1)")
- cursor.execute("INSERT INTO test_alunto_pony (id, pink, weight) VALUES (2, 1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
+ cursor.execute("INSERT INTO test_alunto_pony (pink, weight) VALUES (1, 1)")
cursor.execute("DELETE FROM test_alunto_pony")
# Test flat unique_together
operation = migrations.AlterUniqueTogether("Pony", ("pink", "weight"))