Skip to content

Commit

Permalink
temp: remove unit test in test resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Dec 16, 2024
1 parent 07d604c commit 662ec8f
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions openedx/core/djangoapps/schedules/tests/test_resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,38 +134,6 @@ def test_external_course_updates(self, bucket):
assert len(schedules) == 2
assert {s.enrollment for s in schedules} == {enrollment1, enrollment2}

@override_settings(
OPEN_EDX_FILTERS_CONFIG={
"org.openedx.learning.schedule.queryset.requested.v1": {
"pipeline": [
"openedx.core.djangoapps.schedules.tests.test_filters.TestScheduleQuerySetRequestedPipelineStep",
],
"fail_silently": False,
},
},
)
def test_schedule_filter(self):
"""Confirm that we exclude enrollments in the external course updates experiment"""
user = UserFactory()
overview1 = CourseOverviewFactory(has_highlights=False) # set has_highlights just to avoid a modulestore lookup

# We need to enroll with a request, because our specific experiment code expects it
self.addCleanup(crum.set_current_request, None)
request = RequestFactory().get(self.site)
request.user = user
crum.set_current_request(request)
enrollment1 = CourseEnrollment.enroll(user, overview1.id)
# OK, at this point, we'd expect course1 to be returned, but course2's enrollment to be excluded by the
# experiment. Note that the experiment waffle is currently inactive, but they should still be excluded because
# they were bucketed at enrollment time.
bin_num = BinnedSchedulesBaseResolver.bin_num_for_user_id(user.id)
resolver = BinnedSchedulesBaseResolver(None, self.site, datetime.datetime.now(pytz.UTC), 0, bin_num)
resolver.schedule_date_field = 'created'
schedules = resolver.get_schedules_with_target_date_by_bin_and_orgs()

assert len(schedules) == 1
assert schedules[0].enrollment == enrollment1


@skip_unless_lms
class TestCourseUpdateResolver(SchedulesResolverTestMixin, ModuleStoreTestCase):
Expand Down

0 comments on commit 662ec8f

Please sign in to comment.