AA-177: Add masquerading for course home MFE

- Looks at masquerading config for dates, outline, metadata, and
  celebration APIs in course_home_api / courseware_api.
- Consolidates and cleans up places we check whether masquerading
  gives us full access to a course.
This commit is contained in:
Michael Terry
2020-06-22 17:40:08 -04:00
parent cf5f9482e3
commit 3030efec78
40 changed files with 318 additions and 447 deletions

View File

@@ -96,7 +96,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer):
"""
Returns expiration date for a course audit expiration, if any or null
"""
if not CourseDurationLimitConfig.enabled_for_enrollment(user=model.user, course_key=model.course.id):
if not CourseDurationLimitConfig.enabled_for_enrollment(model.user, model.course):
return None
return get_user_course_expiration_date(model.user, model.course)

View File

@@ -290,7 +290,8 @@ class TestUserEnrollmentApi(UrlResetMixin, MobileAPITestCase, MobileAuthUserTest
course = CourseFactory.create(start=self.LAST_WEEK, mobile_available=True)
self.enroll(course.id)
add_course_mode(course, upgrade_deadline_expired=False)
add_course_mode(course, mode_slug=CourseMode.AUDIT)
add_course_mode(course)
def _get_enrollment_data(self, api_version, expired):
self.login()