fixes for #325 issue

This commit is contained in:
Wilson Júnior
2011-10-19 06:30:41 -02:00
parent 76d771d20f
commit b09c52fc7e
3 changed files with 13 additions and 1 deletions

View File

@@ -997,10 +997,16 @@ class FieldTest(unittest.TestCase):
mongodb = Product(name='MongoDB', company=ten_gen)
mongodb.save()
me = Product(name='MongoEngine')
me.save()
obj = Product.objects(company=ten_gen).first()
self.assertEqual(obj, mongodb)
self.assertEqual(obj.company, ten_gen)
obj = Product.objects(company=None).first()
self.assertEqual(obj, me)
def test_reference_query_conversion(self):
"""Ensure that ReferenceFields can be queried using objects and values
of the type of the primary key of the referenced object.