Browse Source

[FIX] b_worker_status: tests

pull/133/head
Rémy Taymans 5 years ago
parent
commit
72610bc29c
  1. 2
      beesdoo_shift_attendance/__manifest__.py
  2. 8
      beesdoo_shift_attendance/tests/test_beesdoo_shift.py
  3. 2
      beesdoo_worker_status/__manifest__.py
  4. 6
      beesdoo_worker_status/demo/tasks.xml
  5. 0
      beesdoo_worker_status/demo/workers.xml
  6. 25
      beesdoo_worker_status/tests/test_beesdoo_shift.py

2
beesdoo_shift_attendance/__manifest__.py

@ -40,8 +40,6 @@
"views/attendance_sheet.xml", "views/attendance_sheet.xml",
], ],
'demo': [ 'demo': [
"demo/tasks.xml",
"demo/workers.xml",
"demo/users.xml", "demo/users.xml",
] ]
} }

8
beesdoo_shift_attendance/tests/test_beesdoo_shift.py

@ -67,12 +67,12 @@ class TestBeesdooShift(TransactionCase):
) )
self.task_template_1 = self.env.ref( self.task_template_1 = self.env.ref(
"beesdoo_shift_attendance"
".beesdoo_shift_attendance_task_template_1_demo"
"beesdoo_worker_status"
".beesdoo_shift_task_template_1_demo"
) )
self.task_template_2 = self.env.ref( self.task_template_2 = self.env.ref(
"beesdoo_shift_attendance"
".beesdoo_shift_attendance_task_template_2_demo"
"beesdoo_worker_status"
".beesdoo_shift_task_template_2_demo"
) )
# Set time in and out of generation interval parameter # Set time in and out of generation interval parameter

2
beesdoo_worker_status/__manifest__.py

@ -23,5 +23,7 @@
"views/res_partner.xml", "views/res_partner.xml",
], ],
'demo': [ 'demo': [
"demo/workers.xml",
"demo/tasks.xml",
] ]
} }

6
beesdoo_shift_attendance/demo/tasks.xml → beesdoo_worker_status/demo/tasks.xml

@ -5,7 +5,7 @@
--> -->
<odoo> <odoo>
<record id="beesdoo_shift_attendance_task_template_1_demo" model="beesdoo.shift.template">
<record id="beesdoo_shift_task_template_1_demo" model="beesdoo.shift.template">
<field name="name">A_LUN_7:00-9:30</field> <field name="name">A_LUN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" /> <field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_1_demo" /> <field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_1_demo" />
@ -17,7 +17,7 @@
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_1_demo')])]"/> <field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_1_demo')])]"/>
</record> </record>
<record id="beesdoo_shift_attendance_task_template_2_demo" model="beesdoo.shift.template">
<record id="beesdoo_shift_task_template_2_demo" model="beesdoo.shift.template">
<field name="name">A_MAR_12:00-14:30</field> <field name="name">A_MAR_12:00-14:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" /> <field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_2_demo" /> <field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_2_demo" />
@ -30,7 +30,7 @@
<field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_3_demo')])]"/> <field name="worker_ids" eval="[(6, 0, [ref('beesdoo_base.res_partner_cooperator_3_demo')])]"/>
</record> </record>
<record id="beesdoo_shift_attendance_task_template_3_demo" model="beesdoo.shift.template">
<record id="beesdoo_shift_task_template_3_demo" model="beesdoo.shift.template">
<field name="name">A_VEN_7:00-9:30</field> <field name="name">A_VEN_7:00-9:30</field>
<field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" /> <field name="planning_id" ref="beesdoo_shift.beesdoo_shift_planning_1_demo" />
<field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_5_demo" /> <field name="day_nb_id" ref="beesdoo_shift.beesdoo_shift_daynumber_5_demo" />

0
beesdoo_shift_attendance/demo/workers.xml → beesdoo_worker_status/demo/workers.xml

25
beesdoo_worker_status/tests/test_beesdoo_shift.py

@ -14,28 +14,9 @@ class TestBeesdooShift(TransactionCase):
super(TestBeesdooShift, self).setUp() super(TestBeesdooShift, self).setUp()
self.shift_model = self.env["beesdoo.shift.shift"] self.shift_model = self.env["beesdoo.shift.shift"]
self.shift_template_model = self.env["beesdoo.shift.template"] self.shift_template_model = self.env["beesdoo.shift.template"]
self.attendance_sheet_model = self.env["beesdoo.shift.sheet"]
self.attendance_sheet_shift_model = self.env[
"beesdoo.shift.sheet.shift"
]
self.shift_expected_model = self.env["beesdoo.shift.sheet.expected"]
self.shift_added_model = self.env["beesdoo.shift.sheet.added"]
self.task_type_default_id = self.env["ir.config_parameter"].sudo().get_param(
"beesdoo_shift.task_type_default_id"
)
self.current_time = datetime.now() self.current_time = datetime.now()
self.user_admin = self.env.ref("base.user_root") self.user_admin = self.env.ref("base.user_root")
self.user_generic = self.env.ref(
"beesdoo_base.beesdoo_shift_user_1_demo"
)
self.user_permanent = self.env.ref(
"beesdoo_base.beesdoo_shift_user_2_demo"
)
self.setting_wizard = self.env["beesdoo.shift.config.settings"].sudo(
self.user_admin
)
self.worker_regular_1 = self.env.ref( self.worker_regular_1 = self.env.ref(
"beesdoo_base.res_partner_cooperator_6_demo" "beesdoo_base.res_partner_cooperator_6_demo"
@ -67,10 +48,10 @@ class TestBeesdooShift(TransactionCase):
) )
self.task_template_1 = self.env.ref( self.task_template_1 = self.env.ref(
"beesdoo_shift.beesdoo_shift_task_template_1_demo"
"beesdoo_worker_status.beesdoo_shift_task_template_1_demo"
) )
self.task_template_2 = self.env.ref( self.task_template_2 = self.env.ref(
"beesdoo_shift.beesdoo_shift_task_template_2_demo"
"beesdoo_worker_status.beesdoo_shift_task_template_2_demo"
) )
# Set time in and out of generation interval parameter # Set time in and out of generation interval parameter
@ -116,7 +97,7 @@ class TestBeesdooShift(TransactionCase):
"replaced_id": self.worker_regular_2.id, "replaced_id": self.worker_regular_2.id,
} }
) )
future_shift_regular = self.shift_model.create(
self.future_shift_regular = self.shift_model.create(
{ {
"task_template_id": self.task_template_2.id, "task_template_id": self.task_template_2.id,
"task_type_id": self.task_type_1.id, "task_type_id": self.task_type_1.id,

Loading…
Cancel
Save