From 9fbdaf583444bb8f7120165860edb60535e55efc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 30 Nov 2022 10:59:56 +0100 Subject: [PATCH] add test --- tests/test_render_2_0.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index f9f82928..74f57c1f 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -2454,6 +2454,7 @@ def test_bug_3831_documents(user3: UserClientFlask): assert 'Delete Lot' in body assert 'Incoming Lot' in body + lot_id = Lot.query.all()[1].id uri = f'/inventory/lot/{lot_id}/trade-document/add/' body, status = user3.get(uri) @@ -2471,8 +2472,16 @@ def test_bug_3831_documents(user3: UserClientFlask): } uri = f'/inventory/lot/{lot_id}/trade-document/add/' - # body, status = user3.post(uri, data=data, content_type="multipart/form-data") - # assert status == '200 OK' + body, status = user3.post(uri, data=data, content_type="multipart/form-data") + assert status == '200 OK' + + # Second document + uri = f'/inventory/lot/{lot_id}/trade-document/add/' + file_upload = (BytesIO(b_file), file_name) + data['file'] = file_upload + data['csrf_token'] = generate_csrf() + body, status = user3.post(uri, data=data, content_type="multipart/form-data") + assert status == '200 OK' @pytest.mark.mvp