add check of permissions
This commit is contained in:
parent
19bff82873
commit
597ff3dc11
|
@ -226,9 +226,11 @@ def test_export_multiple_different_devices(user: UserClient):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.mvp
|
@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."""
|
"""Test export device information in a csv file."""
|
||||||
snapshot, _ = user.post(file('basic.snapshot'), res=Snapshot)
|
snapshot, _ = user.post(file('basic.snapshot'), res=Snapshot)
|
||||||
|
snapshot2, _ = user2.post(file('basic.snapshot2'), res=Snapshot)
|
||||||
|
|
||||||
csv_str, _ = user.get(res=documents.DocumentDef.t,
|
csv_str, _ = user.get(res=documents.DocumentDef.t,
|
||||||
item='stock/',
|
item='stock/',
|
||||||
accept='text/csv',
|
accept='text/csv',
|
||||||
|
@ -242,6 +244,9 @@ def test_report_devices_stock_control(user: UserClient):
|
||||||
obj_csv = csv.reader(csv_file)
|
obj_csv = csv.reader(csv_file)
|
||||||
fixture_csv = list(obj_csv)
|
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), \
|
assert isinstance(datetime.strptime(export_csv[1][5], '%c'), datetime), \
|
||||||
'Register in field is not a datetime'
|
'Register in field is not a datetime'
|
||||||
|
|
||||||
|
|
Reference in New Issue