From fb4f6f93864aa41ffa806c08aefe983557078863 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Jul 2021 11:54:05 +0200 Subject: [PATCH] adding test for erase documents --- tests/test_action.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_action.py b/tests/test_action.py index 99ef16fe..99d266ab 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -2412,5 +2412,12 @@ def test_trade_case14(user: UserClient, user2: UserClient): @pytest.mark.mvp @pytest.mark.usefixtures(conftest.app_context.__name__) -def test_action_web_erase(user: UserClient, user2: UserClient): - {'type': 'ToErased', 'devices': [174], 'name': 'borrado universal', 'severity': 'Info', 'description': 'nada que describir', 'url': 'http://www.google.com/', 'documentId': '33', 'endTime': '2021-07-07T22:00:00.000Z', 'filename': 'Certificado de borrado1.pdf', 'hash': 'fedbcbd057d25df9915ca9758b7537794148b896b66b3bbc972fe966dcced34b'} +def test_action_web_erase(user: UserClient): + # import pdb; pdb.set_trace() + snap, _ = user.post(file('acer.happy.battery.snapshot'), res=models.Snapshot) + request = {'type': 'ToErased', 'devices': [snap['device']['id']], 'name': 'borrado universal', 'severity': 'Info', 'description': 'nada que describir', 'url': 'http://www.google.com/', 'documentId': '33', 'endTime': '2021-07-07T22:00:00.000Z', 'filename': 'Certificado de borrado1.pdf', 'hash': 'fedbcbd057d25df9915ca9758b7537794148b896b66b3bbc972fe966dcced34b'} + + user.post(res=models.Action, data=request) + action = models.ToErased.query.one() + for dev in action.devices: + assert action in dev.actions