def test_custom_type_mongotype_dict_index_not_checked(self):
        class CustomObject(CustomType):
            mongo_type = dict
            python_type = float
            def to_bson(self, value):
                return {'f':unicode(value)}
            def to_python(self, value):
                return float(value['f'])

        failed = False
        try:
            class MyDocument(Document):
               structure = {'amount': CustomObject()}
               required_fields = ['amount']
               indexes = [{'fields':['amount.f']}]
        except __HOLE__, e:
            self.assertEqual(str(e), "Error in indexes: can't find amount.f in structure")
            failed = True
        self.assertEqual(failed, True)
dataset/ETHPy150Open namlook/mongokit/tests/test_custom_types.py/CustomTypesTestCase.test_custom_type_mongotype_dict_index_not_checked