From 57ed0f1721db9e97d7467d6bb42e800bbe2ce0e0 Mon Sep 17 00:00:00 2001 From: julianajlk Date: Fri, 5 Feb 2021 16:26:46 -0500 Subject: [PATCH] Change LMSPublisher serializer to not convert price to integer, instead to str, letting LMS handle the Decimal conversion --- ecommerce/courses/publishers.py | 2 +- ecommerce/courses/tests/test_publishers.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ecommerce/courses/publishers.py b/ecommerce/courses/publishers.py index e015524fe0e..867b6d535dd 100644 --- a/ecommerce/courses/publishers.py +++ b/ecommerce/courses/publishers.py @@ -38,7 +38,7 @@ def serialize_seat_for_commerce_api(self, seat): return { 'name': mode_for_product(seat), 'currency': stock_record.price_currency, - 'price': int(stock_record.price_excl_tax), + 'price': str(stock_record.price_excl_tax), 'sku': stock_record.partner_sku, 'bulk_sku': bulk_sku, 'expires': self.get_seat_expiration(seat), diff --git a/ecommerce/courses/tests/test_publishers.py b/ecommerce/courses/tests/test_publishers.py index 71cf4c4d4df..8c0ddf5f964 100644 --- a/ecommerce/courses/tests/test_publishers.py +++ b/ecommerce/courses/tests/test_publishers.py @@ -130,7 +130,7 @@ def test_serialize_seat_for_commerce_api(self): expected = { 'name': 'verified', 'currency': 'USD', - 'price': int(stock_record.price_excl_tax), + 'price': str(stock_record.price_excl_tax), 'sku': stock_record.partner_sku, 'bulk_sku': None, 'expires': None, @@ -162,7 +162,7 @@ def test_serialize_seat_for_commerce_api_with_professional(self, is_verified, ex expected = { 'name': expected_mode, 'currency': 'USD', - 'price': int(stock_record.price_excl_tax), + 'price': str(stock_record.price_excl_tax), 'sku': stock_record.partner_sku, 'bulk_sku': None, 'expires': None, @@ -178,7 +178,7 @@ def test_serialize_seat_with_enrollment_code(self): expected = { 'name': 'verified', 'currency': 'USD', - 'price': int(stock_record.price_excl_tax), + 'price': str(stock_record.price_excl_tax), 'sku': stock_record.partner_sku, 'bulk_sku': ec_stock_record.partner_sku, 'expires': None,