diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cc0305b62..2e08ccf9d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,10 @@ Unreleased ---------- * nothing unreleased +[4.27.3] +--------- +* fix: Updating the EnterpriseGroup serializer with created variable + [4.27.2] --------- * fix: updates `get_all_learners` to remove `_get_implicit_group_members` diff --git a/enterprise/__init__.py b/enterprise/__init__.py index 8007e355c..d9d0a5fc4 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "4.27.2" +__version__ = "4.27.3" diff --git a/enterprise/api/v1/serializers.py b/enterprise/api/v1/serializers.py index ab5b072b5..4bef00173 100644 --- a/enterprise/api/v1/serializers.py +++ b/enterprise/api/v1/serializers.py @@ -639,7 +639,7 @@ class Meta: model = models.EnterpriseGroup fields = ( 'enterprise_customer', 'name', 'uuid', 'applies_to_all_contexts', - 'accepted_members_count', 'group_type') + 'accepted_members_count', 'group_type', 'created') accepted_members_count = serializers.SerializerMethodField() diff --git a/tests/test_enterprise/api/test_views.py b/tests/test_enterprise/api/test_views.py index 65c7d9187..8c7fd276b 100644 --- a/tests/test_enterprise/api/test_views.py +++ b/tests/test_enterprise/api/test_views.py @@ -8063,7 +8063,7 @@ def test_successful_retrieve_group(self): """ Test retrieving a single group record """ - # url: 'http://testserver/enterprise/api/v1/enterprise_group/' + # url: 'http://testserver/enterprise/api/v1/enterprise_group//' url = settings.TEST_SERVER + reverse( 'enterprise-group-detail', kwargs={'pk': self.group_1.uuid}, @@ -8475,7 +8475,7 @@ def test_successful_update_group(self): """ Test patching an existing group record """ - # url: 'http://testserver/enterprise/api/v1/enterprise_group/' + # url: 'http://testserver/enterprise/api/v1/enterprise_group//' url = settings.TEST_SERVER + reverse( 'enterprise-group-detail', kwargs={'pk': self.group_1.uuid}, @@ -8494,12 +8494,26 @@ def test_successful_update_group(self): assert response.json().get('enterprise_customer') == str(new_uuid) assert len(EnterpriseGroup.objects.filter(enterprise_customer=str(new_uuid))) == 1 + def test_successful_update_group_name(self): + """ + Test patching an existing group record display name + """ + # url: 'http://testserver/enterprise/api/v1/enterprise_group//' + url = settings.TEST_SERVER + reverse( + 'enterprise-group-detail', + kwargs={'pk': self.group_1.uuid}, + ) + new_name = "new_name" + request_data = {'name': new_name} + response = self.client.patch(url, data=request_data) + assert response.json().get('name') == str(new_name) + def test_successful_delete_group(self): """ Test deleting a group record """ group_to_delete_uuid = EnterpriseGroupFactory(enterprise_customer=self.enterprise_customer).uuid - # url: 'http://testserver/enterprise/api/v1/enterprise_group/' + # url: 'http://testserver/enterprise/api/v1/enterprise_group//' url = settings.TEST_SERVER + reverse( 'enterprise-group-detail', kwargs={'pk': group_to_delete_uuid}, @@ -8741,7 +8755,7 @@ def test_patch_with_bad_request_customer_to_change_to(self): Test that the PATCH endpoint will not allow the user to update a group to a customer that the requester doesn't have access to """ - # url: 'http://testserver/enterprise/api/v1/enterprise_group/' + # url: 'http://testserver/enterprise/api/v1/enterprise_group//' url = settings.TEST_SERVER + reverse( 'enterprise-group-detail', kwargs={'pk': self.group_1.uuid},