From 597ff3dc11c72fd13d3c8dd754963305e7d732fc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 5 Aug 2020 12:24:36 +0200 Subject: [PATCH] add check of permissions --- tests/test_documents.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_documents.py b/tests/test_documents.py index 37ca9c36..8dd8f256 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -226,9 +226,11 @@ def test_export_multiple_different_devices(user: UserClient): @pytest.mark.mvp -def test_report_devices_stock_control(user: UserClient): +def test_report_devices_stock_control(user: UserClient, user2: UserClient): """Test export device information in a csv file.""" snapshot, _ = user.post(file('basic.snapshot'), res=Snapshot) + snapshot2, _ = user2.post(file('basic.snapshot2'), res=Snapshot) + csv_str, _ = user.get(res=documents.DocumentDef.t, item='stock/', accept='text/csv', @@ -242,6 +244,9 @@ def test_report_devices_stock_control(user: UserClient): obj_csv = csv.reader(csv_file) fixture_csv = list(obj_csv) + assert user.user['id'] != user2.user['id'] + assert len(export_csv) == 2 + assert isinstance(datetime.strptime(export_csv[1][5], '%c'), datetime), \ 'Register in field is not a datetime'