From edc19bc9d28048fd4d17ba7981e89c9ce65ed3d8 Mon Sep 17 00:00:00 2001 From: Muhammad Afaq Shuaib Date: Mon, 12 Aug 2024 17:13:21 +0500 Subject: [PATCH] chore: test fixups --- course_discovery/apps/api/tests/test_serializers.py | 4 ++-- .../apps/course_metadata/search_indexes/serializers/course.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/course_discovery/apps/api/tests/test_serializers.py b/course_discovery/apps/api/tests/test_serializers.py index 95e04dd938..33abb93f33 100644 --- a/course_discovery/apps/api/tests/test_serializers.py +++ b/course_discovery/apps/api/tests/test_serializers.py @@ -2352,7 +2352,7 @@ def test_detail_fields_in_response(self, is_post_request): 'restriction_type': ( course_run.restricted_run.restriction_type if hasattr(course_run, 'restricted_run') else None ), - 'fixed_price_usd': course_run.fixed_price_usd, + 'fixed_price_usd': float(course_run.fixed_price_usd), }], 'uuid': str(course.uuid), 'subjects': [subject.name for subject in course.subjects.all()], @@ -2426,7 +2426,7 @@ def get_expected_data(cls, course, course_run, course_skill, seat): 'restriction_type': ( course_run.restricted_run.restriction_type if hasattr(course_run, 'restricted_run') else None ), - 'fixed_price_usd': course_run.fixed_price_usd, + 'fixed_price_usd': float(course_run.fixed_price_usd), }], 'uuid': str(course.uuid), 'subjects': [subject.name for subject in course.subjects.all()], diff --git a/course_discovery/apps/course_metadata/search_indexes/serializers/course.py b/course_discovery/apps/course_metadata/search_indexes/serializers/course.py index 1549e514dc..b8e277dd0c 100644 --- a/course_discovery/apps/course_metadata/search_indexes/serializers/course.py +++ b/course_discovery/apps/course_metadata/search_indexes/serializers/course.py @@ -74,7 +74,7 @@ def course_run_detail(self, request, detail_fields, course_run): 'restriction_type': ( course_run.restricted_run.restriction_type if hasattr(course_run, 'restricted_run') else None ), - 'fixed_price_usd': course_run.fixed_price_usd, + 'fixed_price_usd': float(course_run.fixed_price_usd) if course_run.fixed_price_usd else None, } if detail_fields: course_run_detail.update(