'Tests setting auto_create_index to False on the connection will
disable any index generation.'

def test_disable_index_creation(self):

    class User(Document, ):
        meta = {'allow_inheritance': True, 'indexes': ['user_guid'], 'auto_create_index': False}
        user_guid = StringField(required=True)
    class MongoUser(User, ):
        pass
    User.drop_collection()
    User(user_guid='123').save()
    MongoUser(user_guid='123').save()
    self.assertEqual(2, User.objects.count())
    info = User.objects._collection.index_information()
    self.assertEqual(info.keys(), ['_id_'])
    User.ensure_indexes()
    info = User.objects._collection.index_information()
    self.assertEqual(sorted(info.keys()), ['_cls_1_user_guid_1', '_id_'])
