feat: add enterprise UUID to learner home init data (#31328)

* feat: add enterprise UUID to return object

* style: run black
This commit is contained in:
Nathan Sprenkle
2022-11-22 12:03:43 -05:00
committed by GitHub
parent 231ddd0c57
commit af050d46cb
3 changed files with 4 additions and 5 deletions

View File

@@ -556,6 +556,7 @@ class EnterpriseDashboardSerializer(serializers.Serializer):
label = serializers.CharField(source="name")
url = serializers.SerializerMethodField()
uuid = serializers.UUIDField()
def get_url(self, instance):
return urljoin(

View File

@@ -1135,10 +1135,7 @@ class TestEnterpriseDashboardSerializer(TestCase):
output_data = EnterpriseDashboardSerializer(input_data).data
expected_keys = [
"label",
"url",
]
expected_keys = ["label", "url", "uuid"]
self.assertEqual(output_data.keys(), set(expected_keys))
def test_happy_path(self):
@@ -1155,6 +1152,7 @@ class TestEnterpriseDashboardSerializer(TestCase):
"url": settings.ENTERPRISE_LEARNER_PORTAL_BASE_URL
+ "/"
+ input_data["slug"],
"uuid": input_data["uuid"],
},
)

View File

@@ -879,7 +879,7 @@ class TestCourseRecommendationApiView(SharedModuleStoreTestCase):
"course-v1:BabsonX+EPS03x+Run_0",
"course-v1:TUMx+QPLS2x+Run_0",
"course-v1:NYUx+FCS.NET.1+Run_0",
"course-v1:MichinX+101x+Run_0"
"course-v1:MichinX+101x+Run_0",
]
self.course_data = {
"course_key": "MITx+6.00.1x",