Permalink
Browse files

testing for inheritance of immutability

  • Loading branch information...
1 parent 0c690af commit 2ff210476ef99cbc87b3575e757860945b662c01 @timdiggins timdiggins committed Mar 19, 2012
Showing with 16 additions and 1 deletion.
  1. +2 −1 TODO.txt
  2. +14 −0 tests/test_immutablemodel.py
View
@@ -1 +1,2 @@
-Tests for admin stuff.
+Inheriting options from parent abstract classes?
+Tests for admin stuff.
@@ -310,3 +310,17 @@ def test__delete_locked(self):
0,
len(NoisySignOffField.objects.all()),
)
+
+class Case07_InheritenceTests(TestCase):
+
+ def test01_defaults_work_for_abstract(self):
+ c = ChildModel(parent_field="parent", child_field="child")
+ c.save()
+ c.child_field="other"
+ c.parent_field="other"
+ c.save()
+ db_object = ChildModel.objects.all()[0]
+ for t, name in [(c, 'c'), (db_object, 'db_object')]:
+ self.assertEqual(t.child_field, "child", "expecting %s.child_field" % name)
+ self.assertEqual(t.parent_field, "parent", "expecting %s.parent_field" % name)
+

0 comments on commit 2ff2104

Please sign in to comment.