diff options
| author | Javed Khan <javed@agiliq.com> | 2013-10-07 13:07:35 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-07 09:39:14 -0400 |
| commit | 4dbd95ad65fa3fc86af7391b28a759b401f530d1 (patch) | |
| tree | 1155fef29bc442a562804bf1027d00481e5d97ca /tests | |
| parent | 67f5dffbec366ed50264d32c25facd2681105258 (diff) | |
Fixed #21236 -- Allowed migrations to work with unique_together tuples.
Thanks hjwp for the report.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_operations.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index 723f1ce741..aae1a144ac 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -267,6 +267,10 @@ class OperationTests(MigrationTestBase): 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("DELETE FROM test_alunto_pony") + # Test flat unique_together + operation = migrations.AlterUniqueTogether("Pony", ("pink", "weight")) + operation.state_forwards("test_alunto", new_state) + self.assertEqual(len(new_state.models["test_alunto", "pony"].options.get("unique_together", set())), 1) def test_alter_index_together(self): """ |
