Added test and updated changelog

refs hmarr/mongoengine#527
This commit is contained in:
Ross Lawley 2012-07-11 16:34:28 +01:00
parent 420c6f2d1e
commit d1d30a9280
2 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Changelog
Changes in 0.6.14
=================
- Fixed Int/Float fields and not equals None
- Exclude tests from installation
- Allow tuples for index meta
- Fixed use of str in instance checks

View File

@ -127,6 +127,19 @@ class FieldTest(unittest.TestCase):
self.assertRaises(ValidationError, ret.validate)
def test_int_and_float_ne_operator(self):
class TestDocument(Document):
int_fld = IntField()
float_fld = FloatField()
TestDocument.drop_collection()
TestDocument(int_fld=None, float_fld=None).save()
TestDocument(int_fld=1, float_fld=1).save()
self.assertEqual(1, TestDocument.objects(int_fld__ne=None).count())
self.assertEqual(1, TestDocument.objects(float_fld__ne=None).count())
def test_object_id_validation(self):
"""Ensure that invalid values cannot be assigned to string fields.
"""