From c241abb8202b5f7ecb4aa0fd9b55dd4c7f04d688 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 29 Dec 2025 19:37:02 +0530 Subject: [PATCH] test: fixed evaluator schedule test --- .../doctype/course_evaluator/test_course_evaluator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lms/lms/doctype/course_evaluator/test_course_evaluator.py b/lms/lms/doctype/course_evaluator/test_course_evaluator.py index ad95531a..61e3dc35 100644 --- a/lms/lms/doctype/course_evaluator/test_course_evaluator.py +++ b/lms/lms/doctype/course_evaluator/test_course_evaluator.py @@ -52,8 +52,14 @@ class TestCourseEvaluator(UnitTestCase): return first_date def calculated_last_date_of_schedule(self, first_date): - last_date = add_days(first_date, 56) # 8 weeks course - return last_date + last_day = add_days(first_date, 56) + offset_monday = (0 - last_day.weekday() + 7) % 7 # 0 for Monday + offset_wednesday = (2 - last_day.weekday() + 7) % 7 # 2 for Wednesday + if offset_monday > offset_wednesday and offset_monday < 4: + last_day = add_days(last_day, offset_monday) + else: + last_day = add_days(last_day, offset_wednesday) + return last_day def test_unavailability_dates(self): unavailable_from = getdate(self.evaluator.unavailable_from)