[IMP]GOLEM Season updated tests
This commit is contained in:
parent
0e7e33bada
commit
d701da0c4e
@ -65,14 +65,25 @@ class TestGolemSeason(TransactionCase):
|
|||||||
'date_start' : False,
|
'date_start' : False,
|
||||||
'date_end': '2009-11-01'})
|
'date_end': '2009-11-01'})
|
||||||
|
|
||||||
|
def test_membership(self):
|
||||||
def test__onchange_season_dates(self):
|
|
||||||
""" Test if membership """
|
""" Test if membership """
|
||||||
membership = self.env['product.template'].create({'name': 'Name',
|
new_season = self.env['golem.season'].create({'name': 'Name'})
|
||||||
'membership': True,
|
membership = self.env['product.template'].create({
|
||||||
'membership_date_from': '2017-11-01',
|
'name': 'Name',
|
||||||
'membership_date_to': '2018-11-01'})
|
'season_id': new_season.id,
|
||||||
|
'membership': True,
|
||||||
new_season = self.env['golem.season'].create({'name': 'Name',
|
'membership_date_from': '2017-11-01',
|
||||||
'membership_ids': [(4, membership.id, 0)]})
|
'membership_date_to': '2018-11-01'
|
||||||
|
})
|
||||||
self.assertEqual(new_season.membership_ids[0], membership)
|
self.assertEqual(new_season.membership_ids[0], membership)
|
||||||
|
self.assertEqual(membership.season_id, new_season)
|
||||||
|
membership2 = self.env['product.template'].create({
|
||||||
|
'name': 'Name2',
|
||||||
|
'membership': True,
|
||||||
|
'membership_date_from': '2017-11-01',
|
||||||
|
'membership_date_to': '2018-11-01'
|
||||||
|
})
|
||||||
|
new_season.membership_ids = [(4, membership2.id, False)]
|
||||||
|
self.assertEqual(len(new_season.membership_ids), 2)
|
||||||
|
self.assertEqual(new_season.membership_ids[1], membership2)
|
||||||
|
self.assertEqual(membership2.season_id, new_season)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user