-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] hr_attendance_work_location_ip_check: remove redundant tests (r…
…elated to unused check ip allowed & validate location ip) and update according to get remote ip change
- Loading branch information
1 parent
27b14d0
commit bae487e
Showing
7 changed files
with
11 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,23 +135,6 @@ def test_04_multi_attendance_validation(self): | |
self.env["hr.attendance"].create(vals_list) | ||
self.assertIn("not allowed for", str(context.exception)) | ||
|
||
def test_05_validate_location_ip_direct(self): | ||
"""Test direct validation of location IP.""" | ||
self.mock_ip.return_value = "192.168.1.100" | ||
|
||
with self.with_user("[email protected]"): | ||
# Test with valid IP | ||
self.env["hr.attendance"]._validate_location_ip(self.employee, "check_in") | ||
|
||
# Test with no work location | ||
self.employee.work_location_id = False | ||
self.env["hr.attendance"]._validate_location_ip(self.employee, "check_in") | ||
|
||
# Test with disabled IP check | ||
self.employee.work_location_id = self.work_location | ||
self.work_location.check_ip = False | ||
self.env["hr.attendance"]._validate_location_ip(self.employee, "check_in") | ||
|
||
def test_06_attendance_state_transitions(self): | ||
"""Test attendance state transitions and validations.""" | ||
self.mock_ip.return_value = "192.168.1.100" | ||
|
@@ -166,15 +149,6 @@ def test_06_attendance_state_transitions(self): | |
str(context.exception), | ||
) | ||
|
||
def test_07_validate_location_ip_direct_no_allowed_ip(self): | ||
"""Test direct validation of location IP.""" | ||
self.mock_ip.return_value = "10.0.0.1" # invalid IP | ||
|
||
with self.assertRaises(ValidationError) as context: | ||
# Test with invalid IP | ||
self.env["hr.attendance"]._validate_location_ip(self.employee, "check_in") | ||
self.assertIn("not allowed for", str(context.exception)) | ||
|
||
def test_07_attendance_batch_operations(self): | ||
"""Test batch operations on attendance records.""" | ||
self.mock_ip.return_value = "192.168.1.100" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters