Change the mock database name to "db", because all of the codebase is using this database.

This change enables us to write unit tests without the need to patch the the database name in all of the mongo queries that look like "mongo.db.collection"
This commit is contained in:
VakarisZ 2021-09-24 12:17:39 +03:00
parent 1ab0fe7b13
commit 3781095f25
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,10 @@
import mongoengine import mongoengine
import pytest import pytest
MOCK_DB_NAME = "mongoenginetest" # Database name has to match the db used in the codebase,
# else the name needs to be mocked during tests.
# Currently its used like so: "mongo.db.telemetry.find()".
MOCK_DB_NAME = "db"
@pytest.fixture(scope="module", autouse=True) @pytest.fixture(scope="module", autouse=True)