Skip to content

Commit 5190f42

Browse files
committed
.
1 parent dfff4bc commit 5190f42

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

intrastat_product/tests/test_intrastat_product.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,29 @@ def test_declaration_manual_lines(self):
9797
self.assertEqual(declaration_line.src_dest_country_code, "FR")
9898

9999
# Test Greece country code conversion
100-
computation_line_form.src_dest_country_id = self.env.ref("base.gr")
101-
computation_line_form.save()
102-
declaration_line_form_greece = Form(
100+
computation_line_form = Form(
103101
self.env["intrastat.product.computation.line"].with_context(
104102
default_parent_id=self.declaration.id
105103
)
106104
)
107-
declaration_line_form_greece = declaration_line_form.save()
108-
self.assertEqual(declaration_line_form_greece.src_dest_country_code, "EL")
105+
computation_line_form.src_dest_country_id = self.env.ref("base.gr")
106+
computation_line_form.transaction_id = self.transaction
107+
computation_line_form.hs_code_id = self.hs_code_computer
108+
computation_line_form.region_code = "ZZ"
109+
computation_line_form.product_origin_country_code = "BE"
110+
computation_line_form.transport_id = self.env.ref(
111+
"intrastat_product.intrastat_transport_3"
112+
)
113+
computation_line = computation_line_form.save()
114+
self.assertEqual(computation_line.src_dest_country_code, "EL")
115+
declaration_line_form = Form(
116+
self.env["intrastat.product.declaration.line"].with_context(
117+
default_parent_id=self.declaration.id
118+
)
119+
)
120+
declaration_line_form.src_dest_country_code = "EL"
121+
declaration_line = declaration_line_form.save()
122+
self.assertEqual(declaration_line.src_dest_country_code, "EL")
109123

110124
def test_declaration_no_country(self):
111125
self.demo_company.country_id = False

0 commit comments

Comments
 (0)