File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,15 @@ def app() -> Flask:
3838
3939@pytest .fixture ()
4040def db (app ) -> MongoEngine :
41- app .config ["MONGODB_HOST" ] = "mongodb://localhost:27017/flask_mongoengine_test_db"
41+ app .config ["MONGODB_SETTINGS" ] = [
42+ {
43+ "db" : "flask_mongoengine_test_db" ,
44+ "host" : "localhost" ,
45+ "port" : 27017 ,
46+ "alias" : "default" ,
47+ "uuidRepresentation" : "standard" ,
48+ }
49+ ]
4250 test_db = MongoEngine (app )
4351 db_name = (
4452 test_db .connection ["default" ].get_database ("flask_mongoengine_test_db" ).name
Original file line number Diff line number Diff line change 77@pytest .fixture ()
88def extended_db (app ):
99 app .json_encoder = DummyEncoder
10- app .config ["MONGODB_HOST" ] = "mongodb://localhost:27017/flask_mongoengine_test_db"
10+ app .config ["MONGODB_SETTINGS" ] = [
11+ {
12+ "db" : "flask_mongoengine_test_db" ,
13+ "host" : "localhost" ,
14+ "port" : 27017 ,
15+ "alias" : "default" ,
16+ "uuidRepresentation" : "standard" ,
17+ }
18+ ]
1119 test_db = MongoEngine (app )
1220 db_name = (
1321 test_db .connection ["default" ].get_database ("flask_mongoengine_test_db" ).name
You can’t perform that action at this time.
0 commit comments