From 7552839f9c2d7f6bedf7089b120ae9bcdf15a62e Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 22 Feb 2021 21:17:07 +0100 Subject: [PATCH] updating test for internal stats --- tests/test_documents.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_documents.py b/tests/test_documents.py index ecff4369..74698676 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -462,14 +462,29 @@ def test_get_document_lots(user: UserClient, user2: UserClient): @pytest.mark.mvp -def test_get_document_internal_stats(user: UserClient): +def test_get_document_internal_stats(user: UserClient, user2: UserClient): """Tests for get teh internal stats.""" + # csv_str, _ = user.get(res=documents.DocumentDef.t, + # item='internalstats/') csv_str, _ = user.get(res=documents.DocumentDef.t, - item='internalstats/') + item='internalstats/', + accept='text/csv', + query=[]) f = StringIO(csv_str) obj_csv = csv.reader(f, f) export_csv = list(obj_csv) - assert len(export_csv) == 0 + assert len(export_csv) == 1 + + csv_str, _ = user2.get(res=documents.DocumentDef.t, + item='internalstats/', + accept='text/csv', + query=[]) + + f = StringIO(csv_str) + obj_csv = csv.reader(f, f) + export_csv = list(obj_csv) + + assert csv_str.strip() == '""'