Skip to content

Commit

Permalink
[IMP] hr_attendance_work_location_ip_check: refactor ip check config …
Browse files Browse the repository at this point in the history
…in test files
  • Loading branch information
kongkea-aditi committed Jan 27, 2025
1 parent 78a78a3 commit 27b14d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hr_attendance_work_location_ip_check/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def setUpClass(cls):
)

# Set up test config parameter
param = "hr_attendance.ip_check_enabled"
param = "hr_attendance_work_location_ip_check.ip_check_enabled"
cls.env["ir.config_parameter"].sudo().set_param(param, "True")

# Store common patch path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_01_ip_check_disabled(self):

def test_02_config_changes(self):
"""Test impact of configuration changes"""
param = "hr_attendance.ip_check_enabled"
param = "hr_attendance_work_location_ip_check.ip_check_enabled"
# Disable IP check globally
self.env["ir.config_parameter"].sudo().set_param(param, "False")

Expand Down Expand Up @@ -99,14 +99,14 @@ def test_06_global_ip_check(self):
"""Test global IP check configuration."""
# Test when disabled globally
self.env["ir.config_parameter"].sudo().set_param(
"hr_attendance.ip_check_enabled", "False"
"hr_attendance_work_location_ip_check.ip_check_enabled", "False"
)
result = self.employee._get_ip_check_enabled()
self.assertFalse(result)

# Test when enabled globally
self.env["ir.config_parameter"].sudo().set_param(
"hr_attendance.ip_check_enabled", "True"
"hr_attendance_work_location_ip_check.ip_check_enabled", "True"
)
result = self.employee._get_ip_check_enabled()
self.assertTrue(result)
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_08_ip_allowed_validation(self):
def test_09_ip_check_required_global_disabled(self):
"""Test _is_ip_check_required when global IP check is off."""
self.env["ir.config_parameter"].sudo().set_param(
"hr_attendance.ip_check_enabled", "False"
"hr_attendance_work_location_ip_check.ip_check_enabled", "False"
)
self.assertFalse(self.employee._is_ip_check_required())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_08_ip_check_bypass(self):
"""Test IP check bypass functionality."""
# First ensure IP check is enabled
self.env["ir.config_parameter"].sudo().set_param(
"hr_attendance.ip_check_enabled", "True"
"hr_attendance_work_location_ip_check.ip_check_enabled", "True"
)

# Enable bypass for employee using HR manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def setUpClass(cls):
)

# Set up test config parameter
param = "hr_attendance.ip_check_enabled"
param = "hr_attendance_work_location_ip_check.ip_check_enabled"
cls.env["ir.config_parameter"].sudo().set_param(param, "True")

# Store common patch path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_08_attendance_create_bypass(self):
with self.with_user("[email protected]"):
# Ensure IP check is enabled globally
self.env["ir.config_parameter"].sudo().set_param(
"hr_attendance.ip_check_enabled", "True"
"hr_attendance_work_location_ip_check.ip_check_enabled", "True"
)

# Enable bypass for employee
Expand Down

0 comments on commit 27b14d0

Please sign in to comment.