'Ensure that invalid values cannot be assigned to int fields.'

def test_int_validation(self):

    class Person(Document, ):
        age = IntField(min_value=0, max_value=110)
    person = Person()
    person.age = 50
    person.validate()
    person.age = (-1)
    self.assertRaises(ValidationError, person.validate)
    person.age = 120
    self.assertRaises(ValidationError, person.validate)
    person.age = 'ten'
    self.assertRaises(ValidationError, person.validate)
