'Ensure index specs are inhertited correctly'

def test_index_no_cls(self):

    class A(Document, ):
        title = StringField()
        meta = {'indexes': [{'fields': ('title',), 'cls': False}], 'allow_inheritance': True, 'index_cls': False}
    self.assertEqual([('title', 1)], A._meta['index_specs'][0]['fields'])
    A._get_collection().drop_indexes()
    A.ensure_indexes()
    info = A._get_collection().index_information()
    self.assertEqual(len(info.keys()), 2)
    class B(A, ):
        c = StringField()
        d = StringField()
        meta = {'indexes': [{'fields': ['c']}, {'fields': ['d'], 'cls': True}], 'allow_inheritance': True}
    self.assertEqual([('c', 1)], B._meta['index_specs'][1]['fields'])
    self.assertEqual([('_cls', 1), ('d', 1)], B._meta['index_specs'][2]['fields'])
