# 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



class SchemaTestCase(unittest.TestCase):
    def test_to_primitive(self):
        obj = SimpleSchema(_python_data={'charfield':'charmander'})
        prim_data = obj.to_primitive(obj)
        self.assertEqual(prim_data, {'charfield':'charmander'})
    
    def test_to_portable_primitive(self):

# 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




class SchemaTestCase(unittest.TestCase):
    def test_to_primitive(self):
        obj = SimpleSchema(_python_data={'charfield':'charmander'})
        prim_data = obj.to_primitive(obj)
        self.assertEqual(prim_data, {'charfield':'charmander'})
    
    def test_to_portable_primitive(self):

        obj = SimpleSchema(_python_data={'charfield':'charmander'})