From 20665bf610ed763c0a288625d1a8c54f83d281e3 Mon Sep 17 00:00:00 2001 From: John Nagro Date: Fri, 3 Nov 2023 18:46:19 +0000 Subject: [PATCH] fix: missing content titles on assignments --- enterprise_access/apps/api/v1/tests/test_allocation_view.py | 2 +- enterprise_access/apps/content_assignments/api.py | 2 +- enterprise_access/apps/content_assignments/tests/test_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enterprise_access/apps/api/v1/tests/test_allocation_view.py b/enterprise_access/apps/api/v1/tests/test_allocation_view.py index 20a05034..8885e411 100644 --- a/enterprise_access/apps/api/v1/tests/test_allocation_view.py +++ b/enterprise_access/apps/api/v1/tests/test_allocation_view.py @@ -435,7 +435,7 @@ def test_allocate_happy_path_e2e( assignment records as we'd expect. """ mock_get_and_cache_content_metadata.return_value = { - 'title': self.content_title, + 'content_title': self.content_title, } mock_aggregates_for_policy.return_value = { 'total_quantity': -100 * 100, diff --git a/enterprise_access/apps/content_assignments/api.py b/enterprise_access/apps/content_assignments/api.py index 536e7486..df5c5381 100644 --- a/enterprise_access/apps/content_assignments/api.py +++ b/enterprise_access/apps/content_assignments/api.py @@ -291,7 +291,7 @@ def _get_content_title(assignment_configuration, content_key): assignment_configuration.enterprise_customer_uuid, content_key, ) - return content_metadata.get('title') + return content_metadata.get('content_title') def _create_new_assignments(assignment_configuration, learner_emails, content_key, content_quantity): diff --git a/enterprise_access/apps/content_assignments/tests/test_api.py b/enterprise_access/apps/content_assignments/tests/test_api.py index bf658c21..ba6d1796 100644 --- a/enterprise_access/apps/content_assignments/tests/test_api.py +++ b/enterprise_access/apps/content_assignments/tests/test_api.py @@ -225,7 +225,7 @@ def test_allocate_assignments_happy_path(self, mock_get_and_cache_content_metada f'{name}@foo.com' for name in ('alice', 'bob', 'carol', 'david', 'eugene') ] mock_get_and_cache_content_metadata.return_value = { - 'title': content_title, + 'content_title': content_title, } allocated_assignment = LearnerContentAssignmentFactory.create(