'Ensure list embedded documents can be indexed'

def test_list_embedded_document_index(self):

    class Tag(EmbeddedDocument, ):
        name = StringField(db_field='tag')
    class BlogPost(Document, ):
        title = StringField()
        tags = ListField(EmbeddedDocumentField(Tag))
        meta = {'indexes': ['tags.name']}
    BlogPost.drop_collection()
    info = BlogPost.objects._collection.index_information()
    self.assertEqual(sorted(info.keys()), ['_id_', 'tags.tag_1'])
    post1 = BlogPost(title='Embedded    Indexes    tests    in    place', tags=[Tag(name='about'), Tag(name='time')])
    post1.save()
