updating test for internal stats

This commit is contained in:
Cayo Puigdefabregas 2021-02-22 21:17:07 +01:00
parent 30005e1f91
commit 7552839f9c
1 changed files with 18 additions and 3 deletions

View File

@ -462,14 +462,29 @@ def test_get_document_lots(user: UserClient, user2: UserClient):
@pytest.mark.mvp @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.""" """Tests for get teh internal stats."""
# csv_str, _ = user.get(res=documents.DocumentDef.t,
# item='internalstats/')
csv_str, _ = user.get(res=documents.DocumentDef.t, csv_str, _ = user.get(res=documents.DocumentDef.t,
item='internalstats/') item='internalstats/',
accept='text/csv',
query=[])
f = StringIO(csv_str) f = StringIO(csv_str)
obj_csv = csv.reader(f, f) obj_csv = csv.reader(f, f)
export_csv = list(obj_csv) 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() == '""'