'Ensure that embedded document indexes are created explicitly'

def test_embedded_document_index_meta(self):

    class Rank(EmbeddedDocument, ):
        title = StringField(required=True)
    class Person(Document, ):
        name = StringField(required=True)
        rank = EmbeddedDocumentField(Rank, required=False)
        meta = {'indexes': ['rank.title'], 'allow_inheritance': False}
    self.assertEqual([{'fields': [('rank.title', 1)]}], Person._meta['index_specs'])
    Person.drop_collection()
    list(Person.objects)
    info = Person.objects._collection.index_information()
    info = [value['key'] for (key, value) in info.iteritems()]
    self.assertTrue(([('rank.title', 1)] in info))
