'Ensure that compare_indexes behaves correctly if called from a
class, which base class has multiple subclasses'

def test_compare_indexes_multiple_subclasses(self):

    class BlogPost(Document, ):
        author = StringField()
        title = StringField()
        description = StringField()
        meta = {'allow_inheritance': True}
    class BlogPostWithTags(BlogPost, ):
        tags = StringField()
        tag_list = ListField(StringField())
        meta = {'indexes': [('author', 'tags')]}
    class BlogPostWithCustomField(BlogPost, ):
        custom = DictField()
        meta = {'indexes': [('author', 'custom')]}
    BlogPost.ensure_indexes()
    BlogPostWithTags.ensure_indexes()
    BlogPostWithCustomField.ensure_indexes()
    self.assertEqual(BlogPost.compare_indexes(), {'missing': [], 'extra': []})
    self.assertEqual(BlogPostWithTags.compare_indexes(), {'missing': [], 'extra': []})
    self.assertEqual(BlogPostWithCustomField.compare_indexes(), {'missing': [], 'extra': []})
