From 37b7549efaa2ed858ec3d14bd7979f41f07e5511 Mon Sep 17 00:00:00 2001 From: jawad khan Date: Mon, 19 Feb 2024 20:49:33 +0500 Subject: [PATCH] feat: Add course price in mobile enrollment api (#34255) * feat: Add course price in mobile enrollment api --- lms/djangoapps/mobile_api/users/serializers.py | 1 + lms/djangoapps/mobile_api/users/tests.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lms/djangoapps/mobile_api/users/serializers.py b/lms/djangoapps/mobile_api/users/serializers.py index 77c4b8c668cc..d7005e5f68e7 100644 --- a/lms/djangoapps/mobile_api/users/serializers.py +++ b/lms/djangoapps/mobile_api/users/serializers.py @@ -179,3 +179,4 @@ class ModeSerializer(serializers.Serializer): # pylint: disable=abstract-method sku = serializers.CharField() android_sku = serializers.CharField() ios_sku = serializers.CharField() + min_price = serializers.IntegerField() diff --git a/lms/djangoapps/mobile_api/users/tests.py b/lms/djangoapps/mobile_api/users/tests.py index 7cdd0e76f4e9..65b1fba65ce3 100644 --- a/lms/djangoapps/mobile_api/users/tests.py +++ b/lms/djangoapps/mobile_api/users/tests.py @@ -319,6 +319,12 @@ def _assert_enrollment_results(self, api_version, courses, num_courses_returned, assert 'audit_access_expires' not in courses[0] else: assert 'audit_access_expires' in courses[0] + + for course_mode in courses[0]['course_modes']: + assert 'android_sku' in course_mode + assert 'ios_sku' in course_mode + assert 'min_price' in course_mode + if gating_enabled: assert courses[0].get('audit_access_expires') is not None