From 0bc3ea6ca39c94db1f55447da097ebc259ccd377 Mon Sep 17 00:00:00 2001 From: michel Date: Mon, 15 Jan 2018 15:37:09 +0100 Subject: [PATCH] [TMP] Test --- golem_season/tests/test_golem_season.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/golem_season/tests/test_golem_season.py b/golem_season/tests/test_golem_season.py index def291b..ad16144 100644 --- a/golem_season/tests/test_golem_season.py +++ b/golem_season/tests/test_golem_season.py @@ -58,14 +58,15 @@ class TestGolemSeason(TransactionCase): def test__onchange_season_dates(self): """ Test if membership date """ # je cree un article adhésion - self.env['golem.season'].create({'name': 'Name', - 'membership_id': 'Type adhesion', - 'date_start': '2017-11-01', - 'date_end': '2018-12-31'}) + membership_id = self.env['product.template'].create({'display_name': 'Name', + 'membership_date_from': '2009-11-01', + 'membership_date_to': '2009-11-01'}) # je cree une saison attachée a l'article adhésion new_season = self.env['golem.season'].create({'name': 'Name', - 'membership_id': 'Type adhesion'}) + 'membership_id': membership_id}) + + new_season._onchange_season_dates() # Je teste avec les dates - self.assertEqual(new_season._onchange_season_dates.date_start,'2017-11-01') - self.assertEqual(new_season._onchange_season_dates.date_end,'2018-12-31') + self.assertEqual(new_season._onchange_season_dates.date_start, membership_id.membership_date_from) + self.assertEqual(new_season._onchange_season_dates.date_end, membership_id.membership_date_to)