Skip to content

Commit 95e8567

Browse files
committed
Update db definition in tests
1 parent ce8493e commit 95e8567

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

tests/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ def app() -> Flask:
3838

3939
@pytest.fixture()
4040
def 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

tests/test_json.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
@pytest.fixture()
88
def 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

0 commit comments

Comments
 (0)