'Ensure that manual creation of indexes works.'

def test_ensure_index(self):

    class Comment(Document, ):
        message = StringField()
        meta = {'allow_inheritance': True}
    Comment.ensure_index('message')
    info = Comment.objects._collection.index_information()
    info = [(value['key'], value.get('unique', False), value.get('sparse', False)) for (key, value) in info.iteritems()]
    self.assertTrue((([('_cls', 1), ('message', 1)], False, False) in info))
