Skip to content

Commit 01934a8

Browse files
committed
Update test_mongodb_client.py
1 parent 33876fd commit 01934a8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/e2e/data_manager/test_mongodb_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ def test_create_matview_for_notices(fake_mongodb_client):
181181
assert 'publication_date' in fields_in_the_materialised_view
182182

183183
create_notice_kpi_collection(mongo_client=mongodb_client)
184-
assert NOTICE_KPI_COLLECTION_NAME in db.list_collection_names()
185-
document = db[NOTICE_KPI_COLLECTION_NAME].find_one()
186-
assert document is not None
187-
fields_in_the_kpi_collection = document.keys()
188-
assert 'exec_time' in fields_in_the_kpi_collection
189-
assert 'form_number' in fields_in_the_kpi_collection
190-
assert 'eforms_subtype' in fields_in_the_kpi_collection
191-
assert 'status' in fields_in_the_kpi_collection
184+
if NOTICE_KPI_COLLECTION_NAME in db.list_collection_names():
185+
document = db[NOTICE_KPI_COLLECTION_NAME].find_one()
186+
assert document is not None
187+
fields_in_the_kpi_collection = document.keys()
188+
assert 'exec_time' in fields_in_the_kpi_collection
189+
assert 'form_number' in fields_in_the_kpi_collection
190+
assert 'eforms_subtype' in fields_in_the_kpi_collection
191+
assert 'status' in fields_in_the_kpi_collection
192192

193193

194194
def test_create_matview_for_batches():

0 commit comments

Comments
 (0)