# Path: dockit/tests/schema/common.py
# class SimpleSchema(schema.Schema): #TODO make a more complex testcase
#     charfield = schema.CharField()
# 
# class SimpleDocument(schema.Document): #TODO make a more complex testcase
#     charfield = schema.CharField()
# 
# class ValidatingDocument(schema.Document):
#     with_choices = schema.CharField(choices=[('a','a'), ('b', 'b')])
#     not_null = schema.CharField(null=False)
#     allow_blank = schema.CharField(blank=True)
#     not_blank = schema.CharField(blank=False)
#     subschema = schema.SchemaField(SimpleSchema, null=False)
#     allow_null = schema.CharField(blank=True, null=True)
# 
# class SimpleSchema2(schema.Schema):
#     otherfield = schema.CharField()


from django.utils import unittest
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from dockit.tests.schema.common import SimpleSchema, SimpleDocument, ValidatingDocument, SimpleSchema2
        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:

# Path: dockit/tests/schema/common.py
# class SimpleSchema(schema.Schema): #TODO make a more complex testcase
#     charfield = schema.CharField()
# 
# class SimpleDocument(schema.Document): #TODO make a more complex testcase
#     charfield = schema.CharField()
# 
# class ValidatingDocument(schema.Document):
#     with_choices = schema.CharField(choices=[('a','a'), ('b', 'b')])
#     not_null = schema.CharField(null=False)
#     allow_blank = schema.CharField(blank=True)
#     not_blank = schema.CharField(blank=False)
#     subschema = schema.SchemaField(SimpleSchema, null=False)
#     allow_null = schema.CharField(blank=True, null=True)
# 
# class SimpleSchema2(schema.Schema):
#     otherfield = schema.CharField()


# Path: dockit/tests/schema/schema_tests.py
from django.utils import unittest
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from dockit.tests.schema.common import SimpleSchema, SimpleDocument, ValidatingDocument, SimpleSchema2

        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()