From 078919c9d9ca194eba09d57f589593d1ff1ba839 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 10 Dec 2024 09:15:23 -0500 Subject: [PATCH] fix: include url_for_button_in_modal_v2 in CustomerAgreementSerializer (#611) --- enterprise_access/apps/api/v1/tests/test_bff_views.py | 1 + enterprise_access/apps/api_client/tests/test_utils.py | 6 +++--- enterprise_access/apps/bffs/serializers.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/enterprise_access/apps/api/v1/tests/test_bff_views.py b/enterprise_access/apps/api/v1/tests/test_bff_views.py index 5f642aaa..5a54f495 100644 --- a/enterprise_access/apps/api/v1/tests/test_bff_views.py +++ b/enterprise_access/apps/api/v1/tests/test_bff_views.py @@ -106,6 +106,7 @@ def setUp(self): 'expired_subscription_modal_messaging_v2' ), 'modal_header_text_v2': self.mock_customer_agreement.get('modal_header_text_v2'), + 'url_for_button_in_modal_v2': self.mock_customer_agreement.get('url_for_button_in_modal_v2'), } self.expected_subscription_license = { 'uuid': self.mock_subscription_license.get('uuid'), diff --git a/enterprise_access/apps/api_client/tests/test_utils.py b/enterprise_access/apps/api_client/tests/test_utils.py index 11a2c153..94b3e53d 100644 --- a/enterprise_access/apps/api_client/tests/test_utils.py +++ b/enterprise_access/apps/api_client/tests/test_utils.py @@ -74,7 +74,7 @@ def setUp(self): "days_until_expiration_including_renewals": 50, "is_locked_for_renewal_processing": False, "should_auto_apply_licenses": False, - "created": _days_from_now(-60, DATE_FORMAT_ISO_8601) + "created": _days_from_now(-60, DATE_FORMAT_ISO_8601), } self.mock_customer_agreement = { "uuid": self.mock_customer_agreement_uuid, @@ -92,7 +92,7 @@ def setUp(self): "modal_header_text_v2": None, "expired_subscription_modal_messaging_v2": None, "button_label_in_modal_v2": None, - "url_for_button_in_modal_v2": None + "url_for_button_in_modal_v2": None, } self.mock_subscription_license = { "uuid": self.mock_learner_license_activation_uuid, @@ -103,7 +103,7 @@ def setUp(self): "subscription_plan_uuid": self.mock_subscription_plan_uuid, "revoked_date": None, "activation_key": self.mock_license_activation_key, - "subscription_plan": self.mock_subscription_plan + "subscription_plan": self.mock_subscription_plan, } self.mock_learner_license_auto_apply_response = { **self.mock_subscription_license, diff --git a/enterprise_access/apps/bffs/serializers.py b/enterprise_access/apps/bffs/serializers.py index 0b6c9759..4ebc6886 100644 --- a/enterprise_access/apps/bffs/serializers.py +++ b/enterprise_access/apps/bffs/serializers.py @@ -181,6 +181,7 @@ class CustomerAgreementSerializer(BaseBffSerializer): button_label_in_modal_v2 = serializers.CharField(required=False, allow_null=True) expired_subscription_modal_messaging_v2 = serializers.CharField(required=False, allow_blank=True, allow_null=True) modal_header_text_v2 = serializers.CharField(required=False, allow_null=True) + url_for_button_in_modal_v2 = serializers.CharField(required=False, allow_null=True) class SubscriptionPlanSerializer(BaseBffSerializer):