From afcb5530f808aa96e12be90b4e552270f2e63968 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sun, 24 Oct 2021 13:59:08 +0200 Subject: [PATCH] [14.0][IMP] intrastat_product: Test declaration copy --- intrastat_product/tests/test_intrastat_product.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/intrastat_product/tests/test_intrastat_product.py b/intrastat_product/tests/test_intrastat_product.py index 0e30a7a..8a6b138 100644 --- a/intrastat_product/tests/test_intrastat_product.py +++ b/intrastat_product/tests/test_intrastat_product.py @@ -29,6 +29,16 @@ class TestIntrastatProduct(IntrastatProductCommon): with self.assertRaises(IntegrityError): self._create_transport_mode(vals) + def test_copy(self): + """ + When copying declaration, the new one has an incremented revision + value. + """ + vals = {"declaration_type": "dispatches"} + self._create_declaration(vals) + decl_copy = self.declaration.copy() + self.assertEqual(self.declaration.revision + 1, decl_copy.revision) + class TestIntrastatProductCase(TestIntrastatProduct, SavepointCase): """ Test Intrastat Product """