def test_validation(self):
        obj = ValidatingDocument()
        try:
            obj.full_clean()
        except ValidationError as error:
            self.assertFalse('allow_null' in error.message_dict)
        else:
            self.fail('Validation is broken')
        
        obj.with_choices = 'c'
        obj.not_null = 'foo'
        obj.allow_blank = ''
        obj.not_blank = ''
        try:
            obj.subschema = 'Not a schema'
        except ValidationError as error:
            pass
        else:
            self.fail('Setting a subschema should evaluate immediately')
        
        try:
            obj.full_clean()
        except ValidationError as error:
            self.assertFalse('not_null' in error.message_dict, str(error))
            self.assertFalse('allow_blank' in error.message_dict, str(error))
            self.assertTrue('with_choices' in error.message_dict, str(error))
            self.assertTrue('not_blank' in error.message_dict, str(error))
            self.assertTrue('subschema' in error.message_dict, str(error))
        else:
            self.fail('Validation is broken')
        
        try:
            obj.subschema = SimpleSchema2()
        except __HOLE__ as error:
            pass
        else:
            self.fail('Setting a subschema should evaluate immediately')
        
        obj.with_choices = 'b'
        obj.not_blank = 'foo'
        obj.subschema = SimpleSchema()
        obj.full_clean()
dataset/ETHPy150Open zbyte64/django-dockit/dockit/tests/schema/schema_tests.py/DocumentValidationTestChase.test_validation