'Ensure that tuples remain tuples when they are inside
a ComplexBaseField.'

def test_tuples_as_tuples(self):

    class EnumField(BaseField, ):
        def __init__(self, **kwargs):
            super(EnumField, self).__init__(**kwargs)
        def to_mongo(self, value):
            return value
        def to_python(self, value):
            return tuple(value)
    class TestDoc(Document, ):
        items = ListField(EnumField())
    TestDoc.drop_collection()
    tuples = [(100, 'Testing')]
    doc = TestDoc()
    doc.items = tuples
    doc.save()
    x = TestDoc.objects().get()
    self.assertTrue((x is not None))
    self.assertTrue((len(x.items) == 1))
    self.assertTrue((tuple(x.items[0]) in tuples))
    self.assertTrue((x.items[0] in tuples))
