Now Raise an exception if subclasses are missing at querytime.

Beats returning None thanks to #aid for mentioning it on IRC
This commit is contained in:
Ross Lawley
2011-08-24 13:37:39 +01:00
parent dd49d1d4bb
commit 1631788ab6
3 changed files with 34 additions and 6 deletions

View File

@@ -1062,6 +1062,7 @@ class FieldTest(unittest.TestCase):
Post.drop_collection()
User.drop_collection()
def test_generic_reference_document_not_registered(self):
"""Ensure dereferencing out of the document registry throws a
`NotRegistered` error.
@@ -1445,7 +1446,7 @@ class FieldTest(unittest.TestCase):
a.save()
self.assertEqual(a.counter, 2)
a = Animal.objects.first()
self.assertEqual(a.counter, 2)
a.reload()