1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

A bit of an autodetector and a bit of a writer

This commit is contained in:
Andrew Godwin
2013-06-07 15:28:38 +01:00
parent 3c296382b8
commit 4492f06408
5 changed files with 280 additions and 0 deletions

View File

@@ -68,6 +68,12 @@ class OperationTests(TransactionTestCase):
with connection.schema_editor() as editor:
operation.database_backwards("test_crmo", editor, new_state, project_state)
self.assertTableNotExists("test_crmo_pony")
# And deconstruction
definition = operation.deconstruct()
self.assertEqual(definition[0], "CreateModel")
self.assertEqual(len(definition[1]), 2)
self.assertEqual(len(definition[2]), 0)
self.assertEqual(definition[1][0], "Pony")
def test_delete_model(self):
"""