You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to test a flask application which use flask-mongoengine and when i put "mongomock://localhost" on "MONGODB_HOST" or "MONGODB_SETTINGS" setting i have experienced an error: pymongo.errors.InvalidURI: Invalid URI scheme: URI must begin with 'mongodb://'
It happens because flask-mongengine don't expect mongomock uri like raw mongoengine:
flask-mongoengine _create_connection method:
if "://" in conn.get('host', ''):
uri_dict = uri_parser.parse_uri(conn['host'])
conn['db'] = uri_dict['database']
mongoengine register_connection method:
conn_host = conn_settings['host']
if conn_host.startswith('mongomock://'):
conn_settings['is_mock'] = True
elif '://' in conn_host:
uri_dict = uri_parser.parse_uri(conn_host)
Any advice?
The text was updated successfully, but these errors were encountered:
I'm trying to test a flask application which use flask-mongoengine and when i put "mongomock://localhost" on "MONGODB_HOST" or "MONGODB_SETTINGS" setting i have experienced an error: pymongo.errors.InvalidURI: Invalid URI scheme: URI must begin with 'mongodb://'
It happens because flask-mongengine don't expect mongomock uri like raw mongoengine:
flask-mongoengine _create_connection method:
mongoengine register_connection method:
Any advice?
The text was updated successfully, but these errors were encountered: