Skip to content

Commit

Permalink
[IMP] hr_attendance_rfid: test performance improvement
Browse files Browse the repository at this point in the history
- Switch to setUpClass for avoiding repeat the same setup for each test.
- Include context keys for avoiding mail operations overhead.
  • Loading branch information
josep-tecnativa committed Oct 19, 2023
1 parent 66bb8ac commit 9039b7c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hr_attendance_rfid/tests/test_hr_attendance_rfid_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@


class TestHrAttendance(TransactionCase):
def setUp(self):
@classmethod
def setUpClass(cls):
super().setUp()
self.employee_model = self.env["hr.employee"]
self.test_employee = self.browse_ref("hr.employee_al")
self.rfid_card_code = "5b3f5"
self.test_employee.rfid_card_code = self.rfid_card_code
cls.employee_model = cls.env["hr.employee"]
cls.test_employee = cls.env.ref("hr.employee_al")
cls.rfid_card_code = "5b3f5"
cls.test_employee.rfid_card_code = cls.rfid_card_code

def test_valid_employee(self):
"""Valid employee"""
Expand Down

0 comments on commit 9039b7c

Please sign in to comment.