"""Reference Tax Withholding logic tests.""" from unittest.mock import call, patch from payment.logic import reference_tax_withholding as logic from tests.utils.factories import ReferenceTaxWithholdingFactory @patch('payment.logic.reference_tax_withholding.ReferenceTaxWithholding') def test_get_reference_tax_withholding(mock_model): """Test get_reference_tax_withholding method.""" entry = ReferenceTaxWithholdingFactory.create() mock_model_response = [entry] mock_model.get_all.return_value = mock_model_response res = logic.get_reference_tax_withholding( country_of_tax_residence='GBR', country_of_withholding='USA' ) assert mock_model.get_all.call_args_list == [ call(country_of_withholding='USA', country_of_tax_residence='GBR') ] assert res == { 'items': [entry], 'total_count': 1, }