From bee75d3c1585eb5c87b6e222361d95c90169c95e Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 29 Nov 2016 15:09:46 +0100 Subject: [PATCH 1/3] company model test, country model test --- intrastat_base/tests/__init__.py | 3 +++ intrastat_base/tests/test_all.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 intrastat_base/tests/__init__.py create mode 100644 intrastat_base/tests/test_all.py diff --git a/intrastat_base/tests/__init__.py b/intrastat_base/tests/__init__.py new file mode 100644 index 0000000..9818fd6 --- /dev/null +++ b/intrastat_base/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import test_all diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py new file mode 100644 index 0000000..8151c2e --- /dev/null +++ b/intrastat_base/tests/test_all.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from openerp.tests.common import TransactionCase + + +class TestIntrastatBase(TransactionCase): + """Tests for this module""" + + def setUp(self): + super(TestIntrastatBase, self).setUp() + + def test_10_countries(self): + # check if only EU countries have the 'intrastat' bit set + france = self.env.ref('base.fr') + self.assertTrue(france.intrastat) + brazil = self.env.ref('base.br') + self.assertFalse(brazil.intrastat) + + def test_20_company(self): + # add 'Demo user' to intrastat_remind_user_ids + demo_user = self.env.ref('base.user_demo') + demo_company = self.env.ref('base.main_company') + demo_company.write({ + 'intrastat_remind_user_ids': [(6, False, [demo_user.id])] + }) + # then check if intrastat_email_list contains the email of the user + self.assertEquals(demo_company.intrastat_email_list, demo_user.email) + From ab60489708df3bbc3636c80bc54c0215952b35eb Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 2 Dec 2016 18:13:55 +0100 Subject: [PATCH 2/3] flake8 --- intrastat_base/tests/test_all.py | 1 - 1 file changed, 1 deletion(-) diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index 8151c2e..a5f0de8 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -25,4 +25,3 @@ class TestIntrastatBase(TransactionCase): }) # then check if intrastat_email_list contains the email of the user self.assertEquals(demo_company.intrastat_email_list, demo_user.email) - From af7dee8b43a2413fd15ff3b3ba230c8c225f9c6f Mon Sep 17 00:00:00 2001 From: Tom Blauwendraat Date: Wed, 20 Jun 2018 14:22:20 +0200 Subject: [PATCH 3/3] fixup! flake8 --- intrastat_base/tests/test_all.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index a5f0de8..89ebda2 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -6,9 +6,6 @@ from openerp.tests.common import TransactionCase class TestIntrastatBase(TransactionCase): """Tests for this module""" - def setUp(self): - super(TestIntrastatBase, self).setUp() - def test_10_countries(self): # check if only EU countries have the 'intrastat' bit set france = self.env.ref('base.fr')