Skip to content

Commit

Permalink
[RFC2] l10n_br_cte_spec - test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Nov 12, 2024
1 parent 50a4a1f commit edc695a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions l10n_br_cte_spec/tests/test_cte_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def build_attrs_fake(self, node, create_m2o=False):
if fields.get(key) and fields[key].get("related"):
key = fields[key]["related"][0]
comodel_name = fields[key]["relation"]
elif fields.get(key) and fields[key].get("relation"):
comodel_name = fields[key]["relation"]
else:
clean_type = binding_type.lower()
comodel_name = f"cte.40.{clean_type.split('.')[-1]}"
Expand Down Expand Up @@ -129,4 +131,18 @@ def test_import_cte(self):
.with_context(tracking_disable=True, edoc_type="in", lang="pt_BR")
.build_fake(binding.infCte, create=False)
)

self.assertEqual(cte.cte40_ide.cte40_cCT, "00000004")
self.assertEqual(
cte.cte40_Id, "CTe43120178408960000182570010000000041000000047"
)

self.assertEqual(cte.cte40_emit.cte40_CNPJ, "78408960000182")
self.assertEqual(cte.cte40_receb.cte40_CNPJ, "81639791000104")

self.assertEqual(cte.cte40_exped.cte40_CNPJ, "78408960000182")
self.assertEqual(cte.cte40_dest.cte40_CNPJ, "81639791000104")

self.assertEqual(
cte.cte40_infCTeNorm.cte40_infCarga.cte40_proPred, "Pedra Brita"
)

0 comments on commit edc695a

Please sign in to comment.