'Ensure that invalid values cannot be assigned to an
ObjectIdField.'

def test_object_id_validation(self):

    class Person(Document, ):
        name = StringField()
    person = Person(name='Test    User')
    self.assertEqual(person.id, None)
    person.id = 47
    self.assertRaises(ValidationError, person.validate)
    person.id = 'abc'
    self.assertRaises(ValidationError, person.validate)
    person.id = '497ce96f395f2f052a494fd4'
    person.validate()
