Skip to content

Commit

Permalink
refactor: replace assertDictContainsSubset with assertLessEqual(items…
Browse files Browse the repository at this point in the history
…A, itemsB)
  • Loading branch information
BryanttV committed Feb 6, 2025
1 parent ed4704e commit 5b74e6e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions openedx_filters/learning/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_halt_certificate_process(self, CertificateException, attributes):
"""
exception = CertificateException(message="You can't generate certificate", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -215,7 +215,7 @@ def test_halt_student_auth_process(self, auth_exception, attributes):
"""
exception = auth_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -275,7 +275,7 @@ def test_halt_enrollment_process(self, enrollment_exception, attributes):
"""
exception = enrollment_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_course_enrollments_requested(self):
"""
Expand Down Expand Up @@ -306,7 +306,7 @@ def test_halt_queryset_request(self, request_exception, attributes):
"""
exception = request_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -377,7 +377,7 @@ def test_halt_dashboard_render(self, dashboard_exception, attributes):
"""
exception = dashboard_exception(message="You can't access the dashboard", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

@data(
(CourseAboutRenderStarted.RedirectToPage, {"redirect_to": "custom-course-about.html"}),
Expand All @@ -400,7 +400,7 @@ def test_halt_course_about_render(self, course_about_exception, attributes):
"""
exception = course_about_exception(message="You can't access the course about", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_verticalblock_child_render_started(self):
"""
Expand Down Expand Up @@ -440,7 +440,7 @@ def test_halt_vertical_child_block_render(self, block_render_exception, attribut
"""
exception = block_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_vertical_block_render_completed(self):
"""
Expand Down Expand Up @@ -481,7 +481,7 @@ def test_halt_vertical_block_render(self, render_exception, attributes):
"""
exception = render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_xblock_render_started(self):
"""
Expand Down Expand Up @@ -523,7 +523,7 @@ def test_halt_xblock_render(self, xblock_render_exception, attributes):
"""
exception = xblock_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

@data(
(
Expand All @@ -543,7 +543,7 @@ def test_halt_xblock_render_custom_response(self, xblock_render_exception, attri
"""
exception = xblock_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_account_settings_render_started(self):
"""
Expand Down Expand Up @@ -576,7 +576,7 @@ def test_halt_account_rendering_process(self, AccountSettingsException, attribut
"""
exception = AccountSettingsException(message="You can't access this page", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_instructor_dashboard_render_started(self):
"""
Expand Down Expand Up @@ -611,7 +611,7 @@ def test_halt_instructor_dashboard_render(self, dashboard_exception, attributes)
"""
exception = dashboard_exception(message="You can't access the dashboard", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_ora_submission_view_render_started(self):
"""
Expand Down Expand Up @@ -641,7 +641,7 @@ def test_halt_ora_submission_view_render(self, dashboard_exception, attributes):
"""
exception = dashboard_exception(message="You can't access the view", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


class TestCohortFilters(TestCase):
Expand Down

0 comments on commit 5b74e6e

Please sign in to comment.