summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-05-19 12:35:17 +0200
committerAndrew Godwin <andrew@aeracode.org>2013-05-19 12:35:17 +0200
commit264f8650e375112e874298ec1c5ba65b193fda2a (patch)
tree85ffce9ce472ca513139dc7f9261f83a9a1efefc /tests
parentd58c98d73c41b97e9543f88d3a81ffa6f23e4c7d (diff)
ModelState now freezes options and bases
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_state.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index 5d6a457f72..c6930873ef 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -23,6 +23,7 @@ class StateTests(TestCase):
class Meta:
app_label = "migrations"
app_cache = new_app_cache
+ unique_together = ["name", "bio"]
class Book(models.Model):
title = models.CharField(max_length=1000)
@@ -30,6 +31,8 @@ class StateTests(TestCase):
class Meta:
app_label = "migrations"
app_cache = new_app_cache
+ verbose_name = "tome"
+ db_table = "test_tome"
project_state = ProjectState.from_app_cache(new_app_cache)
author_state = project_state.models['migrations', 'author']
@@ -41,6 +44,7 @@ class StateTests(TestCase):
self.assertEqual(author_state.fields[1][1].max_length, 255)
self.assertEqual(author_state.fields[2][1].null, False)
self.assertEqual(author_state.fields[3][1].null, True)
+ self.assertEqual(author_state.options, {"unique_together": ["name", "bio"]})
self.assertEqual(author_state.bases, (models.Model, ))
self.assertEqual(book_state.app_label, "migrations")
@@ -48,6 +52,7 @@ class StateTests(TestCase):
self.assertEqual([x for x, y in book_state.fields], ["id", "title", "author"])
self.assertEqual(book_state.fields[1][1].max_length, 1000)
self.assertEqual(book_state.fields[2][1].null, False)
+ self.assertEqual(book_state.options, {"verbose_name": "tome", "db_table": "test_tome"})
self.assertEqual(book_state.bases, (models.Model, ))
def test_render(self):