From 02cca7ffbd0416208f2fa4e0b19296cd34ad369a Mon Sep 17 00:00:00 2001 From: Evgeny Tulin Date: Mon, 1 Feb 2021 12:51:03 +0300 Subject: [PATCH] fix test operation_log ref:307f2ff9b2de80f7100cedfa3a3d3e03e7211333 --- tests/test_operation_log.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_operation_log.py b/tests/test_operation_log.py index f0184769..7308b6ca 100644 --- a/tests/test_operation_log.py +++ b/tests/test_operation_log.py @@ -1,3 +1,6 @@ +from decimal import Decimal +import simplejson + import pytest import toloka.client as client @@ -63,7 +66,7 @@ def bonus_operation_log_list(): return [ { "input": { - "amount": 0.01, + "amount": Decimal('0.01'), "public_title": { "RU": "Молодец!", }, @@ -77,7 +80,7 @@ def bonus_operation_log_list(): }, { "input": { - "amount": 0.01, + "amount": Decimal('0.01'), "public_title": { "RU": "Молодец!", }, @@ -176,6 +179,6 @@ def tasks_suite_operation_log_list(): def test_get_operagiton_log(request, requests_mock, toloka_client, toloka_url, object): log_list = request.getfixturevalue(f'{object}_operation_log_list') operation_id = 'ee60ef13-37a3-666a-9220-266daa4b71a7' - requests_mock.get(f'{toloka_url}/operations/{operation_id}/log', json=log_list, status_code=201) + requests_mock.get(f'{toloka_url}/operations/{operation_id}/log', text=simplejson.dumps(log_list), status_code=201) result = toloka_client.get_operation_log(operation_id) assert log_list == client.unstructure(result)