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

def test_boolean_validation(self):

    class Person(Document, ):
        admin = BooleanField()
    person = Person()
    person.admin = True
    person.validate()
    person.admin = 2
    self.assertRaises(ValidationError, person.validate)
    person.admin = 'Yes'
    self.assertRaises(ValidationError, person.validate)
