From 1e8651539193017c95556012eb76013b5e230449 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 8 Sep 2021 14:17:48 +0200 Subject: [PATCH] fixing test moveOnDocument --- tests/test_action.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_action.py b/tests/test_action.py index 345e7101..1333fe78 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -2443,7 +2443,7 @@ def test_action_web_erase(user: UserClient, client: Client): @pytest.mark.mvp @pytest.mark.usefixtures(conftest.app_context.__name__) -def test_moveonContainer(user: UserClient, user2: UserClient): +def test_moveOnDocument(user: UserClient, user2: UserClient): lotIn, _ = user.post({'name': 'MyLotIn'}, res=Lot) lotOut, _ = user.post({'name': 'MyLotOut'}, res=Lot) url = 'http://www.ereuse.org/apapaapaapaapaapaapaapaapaapaapapaapaapaapaapaapaapaapaapaapapaapaapaapaapaapaapaapaapaapaaaa', @@ -2455,9 +2455,10 @@ def test_moveonContainer(user: UserClient, user2: UserClient): 'lot': lotIn['id'] } tradedocument_from, _ = user.post(res=TradeDocument, data=request_post1) + id_hash = 'aaaaaaaaa' request_post2 = { 'filename': 'test.pdf', - 'hash': 'bbbbbbbb', + 'hash': id_hash, 'url': url, 'weight': 0, 'lot': lotOut['id'] @@ -2478,14 +2479,16 @@ def test_moveonContainer(user: UserClient, user2: UserClient): user.post(res=models.Action, data=request_trade) request_moveOn = { - 'type': 'MoveOnContainer', + 'type': 'MoveOnDocument', 'weight': 15, - 'devices': [], 'container_from': tradedocument_from['id'], - 'container_to': tradedocument_to['id'] + 'container_to': id_hash } doc, _ = user.post(res=models.Action, data=request_moveOn) assert doc['weight'] == request_moveOn['weight'] assert doc['container_from']['id'] == tradedocument_from['id'] assert doc['container_to']['id'] == tradedocument_to['id'] + + tradedocument_to, _ = user.post(res=TradeDocument, data=request_post2) + user.post(res=models.Action, data=request_moveOn, status=422)