1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.7.x] Fixed #23880 -- Added missing index_together handling for SQLite

Backport of d2202ec2d4 from master
This commit is contained in:
Markus Holtermann
2014-11-30 18:11:52 +01:00
committed by Tim Graham
parent d62e16fe46
commit ba3e976186
3 changed files with 23 additions and 5 deletions

View File

@@ -1012,16 +1012,14 @@ class OperationTests(OperationTestBase):
cursor.execute("INSERT INTO test_rnfl_pony (blue, weight) VALUES (1, 1)")
cursor.execute("DELETE FROM test_rnfl_pony")
# Ensure the index constraint has been ported over
# TODO: Uncomment assert when #23880 is fixed
# self.assertIndexExists("test_rnfl_pony", ["weight", "blue"])
self.assertIndexExists("test_rnfl_pony", ["weight", "blue"])
# And test reversal
with connection.schema_editor() as editor:
operation.database_backwards("test_rnfl", editor, new_state, project_state)
self.assertColumnExists("test_rnfl_pony", "pink")
self.assertColumnNotExists("test_rnfl_pony", "blue")
# Ensure the index constraint has been reset
# TODO: Uncomment assert when #23880 is fixed
# self.assertIndexExists("test_rnfl_pony", ["weight", "pink"])
self.assertIndexExists("test_rnfl_pony", ["weight", "pink"])
def test_alter_unique_together(self):
"""