Ajout du test de création du membre : test de la liste des attentes vide

This commit is contained in:
eloyoussef 2018-03-02 14:37:08 +01:00
parent 1faad1bf15
commit afc3c3acf9
3 changed files with 41 additions and 1 deletions

View File

@ -41,3 +41,5 @@ class TestGolemActivity(TransactionCase):
self.assertTrue(activity.queue_allowed) self.assertTrue(activity.queue_allowed)
self.assertTrue(activity.auto_registration_from_queue) self.assertTrue(activity.auto_registration_from_queue)
self.assertEqual(activity.queue_activity_number, 0) self.assertEqual(activity.queue_activity_number, 0)
self.assertFalse(activity.activity_registration_ids)
self.assertFalse(activity.activity_queue_ids)

View File

@ -26,7 +26,7 @@ class TestGolemActivityQueue(TransactionCase):
""" GOLEM Activity Queue testing """ """ GOLEM Activity Queue testing """
def setUp(self, *args, **kwargs): def setUp(self, *args, **kwargs):
""" Bootstrap Resource """ """ Bootstrap ActivityQueue """
super(TestGolemActivityQueue, self).setUp(*args, **kwargs) super(TestGolemActivityQueue, self).setUp(*args, **kwargs)
self.season = self.env['golem.season'].sudo().create({'name': u'Season 1'}) self.season = self.env['golem.season'].sudo().create({'name': u'Season 1'})

View File

@ -25,3 +25,41 @@ from odoo.tests.common import TransactionCase
class TestGolemMember(TransactionCase): class TestGolemMember(TransactionCase):
""" GOLEM member testing """ """ GOLEM member testing """
def setUp(self, *args, **kwargs):
""" Bootstrap member """
super(TestGolemMember, self).setUp(*args, **kwargs)
self.data1 = {'lastname': u'LAST1', 'firstname': u'First1'}
self.data2 = {'lastname': u'LAST2', 'firstname': u'First2'}
self.data3 = {'lastname': u'LAST3', 'firstname': u'First3'}
self.member1 = self.env['golem.member']
self.member2 = self.env['golem.member']
self.member3 = self.env['golem.member']
def test_member_creation(self):
""" Test member creation """
member1 = self.member1.create(self.data1)
self.assertFalse(member1.activity_queue_ids)
"""
self.member2 = mcrt({'lastname': u'LAST', 'firstname': u'Young'})
self.season = self.env['golem.season'].sudo().create({'name': u'Season 1'})
self.data = {
'name': u'Activity 1',
'season_id': self.season.id,
'type_id': type_id
}
super(TestGolemMember, self).setUp(*args, **kwargs)
self.member_numberconfig_model = self.env['golem.member.numberconfig']
season_mdl = self.env['golem.season'].sudo()
self.season_current = season_mdl.create({'name': u'Current'})
self.season_current.do_default_season()
self.season_next = season_mdl.create({'name': u'Next'})
self.member_model = self.env['golem.member'].sudo()
mcrt = self.member_model.create
self.member1 = mcrt({'lastname': u'LAST', 'firstname': u'First'})
self.member2 = mcrt({'lastname': u'LAST', 'firstname': u'Young',
'birthdate_date': '2016-01-01'})
"""