feat: TNL-10136 Propagate changes from last PR
This commit is contained in:
@@ -301,7 +301,8 @@ class CourseApiTestViews(BaseCoursewareTests, MasqueradeMixin):
|
||||
""" Test that metadata endpoint returns data for the streak celebration """
|
||||
CourseEnrollment.enroll(self.user, self.course.id, 'audit')
|
||||
with override_waffle_flag(COURSEWARE_MFE_MILESTONES_STREAK_DISCOUNT, active=True):
|
||||
with mock.patch('common.djangoapps.student.models.UserCelebration.perform_streak_updates', return_value=3):
|
||||
UPDATE_MTHD_NAME = 'common.djangoapps.student.models.user.UserCelebration.perform_streak_updates'
|
||||
with mock.patch(UPDATE_MTHD_NAME, return_value=3):
|
||||
response = self.client.get(self.url, content_type='application/json')
|
||||
celebrations = response.json()['celebrations']
|
||||
assert celebrations['streak_length_to_celebrate'] == 3
|
||||
@@ -311,7 +312,8 @@ class CourseApiTestViews(BaseCoursewareTests, MasqueradeMixin):
|
||||
""" Test that metadata endpoint does not return a discount and signal is not sent if flag is not set """
|
||||
CourseEnrollment.enroll(self.user, self.course.id, 'audit')
|
||||
with override_waffle_flag(COURSEWARE_MFE_MILESTONES_STREAK_DISCOUNT, active=False):
|
||||
with mock.patch('common.djangoapps.student.models.UserCelebration.perform_streak_updates', return_value=3):
|
||||
UPDATE_MTHD_NAME = 'common.djangoapps.student.models.user.UserCelebration.perform_streak_updates'
|
||||
with mock.patch(UPDATE_MTHD_NAME, return_value=3):
|
||||
response = self.client.get(self.url, content_type='application/json')
|
||||
celebrations = response.json()['celebrations']
|
||||
assert celebrations['streak_length_to_celebrate'] == 3
|
||||
|
||||
Reference in New Issue
Block a user