From a67adf5036ac06e9694d6d1c8071d03fc5e68b72 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 2 Apr 2026 14:08:02 -0400 Subject: [PATCH 1/2] chore: Update default start date to January 1, 2040 Push this forward so things don't automatically in a few years for future courses. --- xmodule/course_metadata_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmodule/course_metadata_utils.py b/xmodule/course_metadata_utils.py index ea6c15cc803c..fd195b18f7a6 100644 --- a/xmodule/course_metadata_utils.py +++ b/xmodule/course_metadata_utils.py @@ -14,7 +14,7 @@ import dateutil.parser -DEFAULT_START_DATE = datetime(2030, 1, 1, tzinfo=ZoneInfo("UTC")) +DEFAULT_START_DATE = datetime(2040, 1, 1, tzinfo=ZoneInfo("UTC")) """ Default grading policy for a course run. From d4b55705feac6afbe2987ba294c767dd537275f5 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Fri, 10 Apr 2026 15:54:42 -0400 Subject: [PATCH 2/2] fix: update hardcoded start date literals in tests to use DEFAULT_START_DATE Tests were asserting against the literal `2030-01-01` value instead of importing the constant, causing failures after the default was updated to 2040. Co-Authored-By: Claude Sonnet 4.6 --- .../rest_api/v1/views/tests/test_proctoring.py | 7 ++++--- cms/djangoapps/contentstore/signals/tests/test_handlers.py | 3 ++- cms/djangoapps/contentstore/views/tests/test_block.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_proctoring.py b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_proctoring.py index ae94a7ccecf2..79f65c7f5dd3 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_proctoring.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_proctoring.py @@ -15,6 +15,7 @@ from cms.djangoapps.contentstore.tests.utils import CourseTestCase from openedx.core import toggles as core_toggles from openedx.core.djangoapps.course_apps.toggles import EXAMS_IDA +from xmodule.course_metadata_utils import DEFAULT_START_DATE from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from xmodule.modulestore.tests.django_utils import ( # lint-amnesty, pylint: disable=wrong-import-order ModuleStoreTestCase, @@ -59,7 +60,7 @@ def get_expected_response_data( "proctoring_escalation_email": course.proctoring_escalation_email, "create_zendesk_tickets": course.create_zendesk_tickets, }, - "course_start_date": "2030-01-01T00:00:00Z", + "course_start_date": DEFAULT_START_DATE.strftime('%Y-%m-%dT%H:%M:%SZ'), "available_proctoring_providers": ["null"], "requires_escalation_email_providers": [], } @@ -98,7 +99,7 @@ def test_providers_with_disabled_lti(self): "proctoring_escalation_email": self.course.proctoring_escalation_email, "create_zendesk_tickets": self.course.create_zendesk_tickets, }, - "course_start_date": "2030-01-01T00:00:00Z", + "course_start_date": DEFAULT_START_DATE.strftime('%Y-%m-%dT%H:%M:%SZ'), "available_proctoring_providers": ["null"], "requires_escalation_email_providers": [], } @@ -121,7 +122,7 @@ def test_providers_with_enabled_lti(self): "proctoring_escalation_email": self.course.proctoring_escalation_email, "create_zendesk_tickets": self.course.create_zendesk_tickets, }, - "course_start_date": "2030-01-01T00:00:00Z", + "course_start_date": DEFAULT_START_DATE.strftime('%Y-%m-%dT%H:%M:%SZ'), "available_proctoring_providers": ["lti_external", "null"], "requires_escalation_email_providers": ["lti_external"], } diff --git a/cms/djangoapps/contentstore/signals/tests/test_handlers.py b/cms/djangoapps/contentstore/signals/tests/test_handlers.py index f70a8a11fabb..25e7512a1f71 100644 --- a/cms/djangoapps/contentstore/signals/tests/test_handlers.py +++ b/cms/djangoapps/contentstore/signals/tests/test_handlers.py @@ -9,6 +9,7 @@ from openedx_events.content_authoring.data import CourseCatalogData, CourseScheduleData import cms.djangoapps.contentstore.signals.handlers as sh +from xmodule.course_metadata_utils import DEFAULT_START_DATE from xmodule.modulestore.django import SignalHandler from xmodule.modulestore.edit_info import EditInfoMixin from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -34,7 +35,7 @@ def setUp(self): course_key=CourseLocator(org='TestU', course='sig101', run='Summer2022', branch=None, version_guid=None), name='Signals 101', schedule_data=CourseScheduleData( - start=datetime.fromisoformat('2030-01-01T00:00+00:00'), + start=DEFAULT_START_DATE, pacing='instructor', end=None, enrollment_start=None, diff --git a/cms/djangoapps/contentstore/views/tests/test_block.py b/cms/djangoapps/contentstore/views/tests/test_block.py index 2b99dbb4eb7b..4c22789cfb6d 100644 --- a/cms/djangoapps/contentstore/views/tests/test_block.py +++ b/cms/djangoapps/contentstore/views/tests/test_block.py @@ -593,11 +593,11 @@ def test_create_block_negative(self): self.assertEqual(resp.status_code, 200) # noqa: PT009 def test_create_with_future_date(self): - self.assertEqual(self.course.start, datetime(2030, 1, 1, tzinfo=UTC)) # noqa: PT009 + self.assertEqual(self.course.start, DEFAULT_START_DATE) # noqa: PT009 resp = self.create_xblock(category="chapter") usage_key = self.response_usage_key(resp) obj = self.get_item_from_modulestore(usage_key) - self.assertEqual(obj.start, datetime(2030, 1, 1, tzinfo=UTC)) # noqa: PT009 + self.assertEqual(obj.start, DEFAULT_START_DATE) # noqa: PT009 def test_static_tabs_initialization(self): """ @@ -3395,7 +3395,7 @@ def validate_chapter_xblock_info(self, xblock_info, has_child_info=True): xblock_info["course_graders"], ["Homework", "Lab", "Midterm Exam", "Final Exam"], ) - self.assertEqual(xblock_info["start"], "2030-01-01T00:00:00Z") # noqa: PT009 + self.assertEqual(xblock_info["start"], DEFAULT_START_DATE.strftime('%Y-%m-%dT%H:%M:%SZ')) # noqa: PT009 self.assertEqual(xblock_info["graded"], False) # noqa: PT009 self.assertEqual(xblock_info["due"], None) # noqa: PT009 self.assertEqual(xblock_info["format"], None) # noqa: PT009