From b5e81d3a6ea024165382cb58670ca232f7d473dc Mon Sep 17 00:00:00 2001 From: Eduardo De Miguel Date: Fri, 10 Jun 2022 10:55:32 +0200 Subject: [PATCH] [FIX] Set country id with ref, one line exercise test_validate_wrong_vat_shows_simple_message --- base_vat_optional_vies/tests/test_res_partner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base_vat_optional_vies/tests/test_res_partner.py b/base_vat_optional_vies/tests/test_res_partner.py index 400734fa..2313b29d 100644 --- a/base_vat_optional_vies/tests/test_res_partner.py +++ b/base_vat_optional_vies/tests/test_res_partner.py @@ -24,7 +24,7 @@ class TestResPartner(common.TransactionCase): with mock.patch(self.vatnumber_path) as mock_vatnumber: mock_vatnumber.check_vies.return_value = True self.partner.vat = "ESB87530432" - self.partner.country_id = 20 + self.partner.country_id = self.env.ref("base.be") self.assertEqual(self.partner.vies_passed, True) def test_exception_vat_vies(self): @@ -44,14 +44,14 @@ class TestResPartner(common.TransactionCase): self.company.vat_check_vies = False mock_vatnumber.check_vies.return_value = False self.partner.vat = "MXGODE561231GR8" - self.partner.country_id = 156 + self.partner.country_id = self.env.ref("base.mx") self.assertEqual(self.partner.vies_passed, False) def test_validate_vies_passed_false_when_vat_set_to_false(self): with mock.patch(self.vatnumber_path) as mock_vatnumber: mock_vatnumber.check_vies.return_value = True self.partner.vat = "ESB87530432" - self.partner.country_id = 20 + self.partner.country_id = self.env.ref("base.be") self.assertEqual(self.partner.vies_passed, True) self.partner.vat = False self.assertEqual(self.partner.vies_passed, False) @@ -59,4 +59,3 @@ class TestResPartner(common.TransactionCase): def test_validate_wrong_vat_shows_simple_message(self): with self.assertRaisesRegex(ValidationError, "does not seem to be valid"): self.partner.vat = "ES11111111A" - self.partner.country_id = 20