diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc index 81bc1a2e..f538f2ef 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc @@ -10,8 +10,8 @@ "type": "record", "fields": [ { - "name": "status", - "type": "string" + "name": "is_passing", + "type": "boolean" }, { "name": "user", diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc index a20b821f..89da6104 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc @@ -10,8 +10,8 @@ "type": "record", "fields": [ { - "name": "status", - "type": "string" + "name": "is_passing", + "type": "boolean" }, { "name": "course", diff --git a/openedx_events/event_bus/avro/tests/test_custom_serializers.py b/openedx_events/event_bus/avro/tests/test_custom_serializers.py index e979a942..45be6cc2 100644 --- a/openedx_events/event_bus/avro/tests/test_custom_serializers.py +++ b/openedx_events/event_bus/avro/tests/test_custom_serializers.py @@ -8,13 +8,23 @@ class TestCCXLocatorSerailizer(TestCase): + """Test case for CCXLocator serializer.""" + def test_serialize(self): + """ + Test case for serializing CCXLocator object. + """ + obj1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") expected1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" result1 = CcxCourseLocatorAvroSerializer.serialize(obj1) self.assertEqual(result1, expected1) def test_deseialize(self): + """ + Test case for deserializing CCXLocator object. + """ + data1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" expected1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") result1 = CcxCourseLocatorAvroSerializer.deserialize(data1) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 83a76a60..7f183102 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -528,14 +528,13 @@ class CoursePassingStatusData: Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. Attributes: - status (str): A string containing information about user's current course grade value - in comparison to the grading policy threshold. + is_passing (bool): Indicates whether the user's grade is enough to pass the course. user (UserData): An instance of UserData containing information about the user whose grade was updated. course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. """ - status = attr.ib(type=str) + is_passing = attr.ib(type=bool) course = attr.ib(type=CourseData) user = attr.ib(type=UserData)