Skip to content

Commit

Permalink
Fix typo in mongo connection string #2714
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jun 20, 2022
1 parent 0d8430a commit 84b44ef
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def client_with_patched_mongo(monkeypatch):
# configure controllers
monkeypatch.setenv("DATA_STORAGE_BACKEND", "mongodb")
monkeypatch.setenv(
"MONGO_CONNECTION_STRING", "mongodb://localhost/27017"
"MONGO_CONNECTION_STRING", "mongodb://localhost:27017/outbreak"
) # will be unused
monkeypatch.setenv("MONGO_DB", "outbreak")
monkeypatch.setenv("MONGO_CASE_COLLECTION", "cases")
Expand All @@ -28,7 +28,7 @@ def fake_mongo(connection_string):

def test_get_case_with_known_id(client_with_patched_mongo):
# insert a case
db = pymongo.MongoClient("mongodb://localhost/27017")
db = pymongo.MongoClient("mongodb://localhost:27017/outbreak")
case_id = (
db["outbreak"]["cases"]
.insert_one({"confirmation_date": "2021-12-31T01:23:45.678Z"})
Expand All @@ -54,4 +54,4 @@ def test_get_case_with_valid_absent_id(client_with_patched_mongo):
def test_list_cases_when_none_present_is_empty_list(client_with_patched_mongo):
response = client_with_patched_mongo.get(f"/api/cases")
assert response.status_code == 200
assert response.json == []
assert response.json == []

0 comments on commit 84b44ef

Please sign in to comment.