"""Test manual_adjustment util functions.""" from unittest.mock import patch from api.utils import manual_adjustment @patch('api.utils.manual_adjustment.request') def test_fetch_expenses(request): """Test fetch_expense function.""" vendor_id = 54321 manual_adjustment.get(vendor_id) args = request.process.call_args_list[0][0] assert 'page_offset=0' in args[4] assert 'parent_id=54321' in args[4] @patch('api.utils.manual_adjustment.request') def test_fetch_expenses_cid(request): """Test fetch_expense function with correlation id.""" vendor_id = 54321 correlation_id = '1111-2222-3333-4444' manual_adjustment.get(vendor_id, correlation_id=correlation_id) args, kwargs = request.process.call_args_list[0] assert 'parent_id=54321' in args[4] assert 'page_offset=0' in args[4] assert kwargs['correlation_id'] == correlation_id