From fefab96ab0676553d8256a49663768ae84dabd77 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Thu, 12 Dec 2024 09:42:34 -0500 Subject: [PATCH] chore: remove PreventScheduleQuerySetRequest exception --- openedx_filters/learning/filters.py | 19 ------------------ .../learning/tests/test_filters.py | 20 +------------------ 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/openedx_filters/learning/filters.py b/openedx_filters/learning/filters.py index a529e534..3c2f995a 100644 --- a/openedx_filters/learning/filters.py +++ b/openedx_filters/learning/filters.py @@ -829,25 +829,6 @@ class ScheduleQuerySetRequested(OpenEdxPublicFilter): filter_type = "org.openedx.learning.schedule.queryset.requested.v1" - class PreventScheduleQuerySetRequest(OpenEdxFilterException): - """ - Custom exception to halt the schedule QuerySet request process. - - This exception is raised when the filtering process encounters a condition - that prevents further processing of the QuerySet. It returns the original - QuerySet. - """ - - def __init__(self, message: str, schedules: QuerySet): - """ - Initialize the PreventScheduleQuerySetRequest with a message and a QuerySet. - - Arguments: - message (str): A descriptive error message for the exception. - schedules (QuerySet): The QuerySet of schedules causing the exception. - """ - super().__init__(message, schedules=schedules) - @classmethod def run_filter(cls, schedules: QuerySet) -> QuerySet: """ diff --git a/openedx_filters/learning/tests/test_filters.py b/openedx_filters/learning/tests/test_filters.py index dc76a82d..a84e31dc 100644 --- a/openedx_filters/learning/tests/test_filters.py +++ b/openedx_filters/learning/tests/test_filters.py @@ -793,28 +793,10 @@ def test_schedule_requested(self): Test schedule requested filter. Expected behavior: - - The filter should return the filterd schedules. + - The filter should return the filtered schedules. """ schedules = Mock() result = ScheduleQuerySetRequested.run_filter(schedules) self.assertEqual(schedules, result) - - @data( - ( - ScheduleQuerySetRequested.PreventScheduleQuerySetRequest, - {"schedules": Mock(), "message": "Can't request QuerySet Schedule."} - ) - ) - @unpack - def test_halt_queryset_request(self, request_exception, attributes): - """ - Test for queryset request exceptions attributes. - - Expected behavior: - - The exception must have the attributes specified. - """ - exception = request_exception(**attributes) - - self.assertDictContainsSubset(attributes, exception.__dict__)