Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: return modified date information on get component endpoint [FC-0062] #35508

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openedx/core/djangoapps/content_libraries/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class LibraryXBlockMetadataSerializer(serializers.Serializer):
last_draft_created_by = serializers.CharField(read_only=True)
has_unpublished_changes = serializers.BooleanField(read_only=True)
created = serializers.DateTimeField(format=DATETIME_FORMAT, read_only=True)
modified = serializers.DateTimeField(format=DATETIME_FORMAT, read_only=True)

# When creating a new XBlock in a library, the slug becomes the ID part of
# the definition key and usage key:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
"""
Tests for Learning-Core-based Content Libraries
"""
from unittest.mock import Mock, patch
from datetime import datetime, timezone
from unittest import skip
from unittest.mock import Mock, patch
from uuid import uuid4

import ddt
from datetime import datetime, timezone
from uuid import uuid4
from django.contrib.auth.models import Group
from django.test.client import Client
from freezegun import freeze_time
from organizations.models import Organization
from rest_framework.test import APITestCase

from opaque_keys.edx.locator import LibraryLocatorV2, LibraryUsageLocatorV2
from openedx_events.content_authoring.data import ContentLibraryData, LibraryBlockData
from openedx_events.content_authoring.signals import (
Expand All @@ -21,20 +18,23 @@
CONTENT_LIBRARY_UPDATED,
LIBRARY_BLOCK_CREATED,
LIBRARY_BLOCK_DELETED,
LIBRARY_BLOCK_UPDATED,
LIBRARY_BLOCK_UPDATED
)
from openedx_events.tests.utils import OpenEdxEventsTestMixin
from organizations.models import Organization
from rest_framework.test import APITestCase

from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.content_libraries.constants import CC_4_BY, COMPLEX, PROBLEM, VIDEO
from openedx.core.djangoapps.content_libraries.tests.base import (
ContentLibrariesRestApiTest,
URL_BLOCK_GET_HANDLER_URL,
URL_BLOCK_METADATA_URL,
URL_BLOCK_RENDER_VIEW,
URL_BLOCK_GET_HANDLER_URL,
URL_BLOCK_XBLOCK_HANDLER,
ContentLibrariesRestApiTest
)
from openedx.core.djangoapps.content_libraries.constants import VIDEO, COMPLEX, PROBLEM, CC_4_BY
from openedx.core.djangoapps.xblock import api as xblock_api
from openedx.core.djangolib.testing.utils import skip_unless_cms
from common.djangoapps.student.tests.factories import UserFactory


@skip_unless_cms
Expand Down Expand Up @@ -1049,6 +1049,9 @@ def test_library_paste_clipboard(self):
self.assertDictContainsEntries(self._get_library_block(paste_data["id"]), {
**block_data,
"last_draft_created_by": None,
"last_draft_created": paste_data["last_draft_created"],
"created": paste_data["created"],
"modified": paste_data["modified"],
"id": f"lb:CL-TEST:test_lib_paste_clipboard:problem:{pasted_block_id}",
})

Expand Down
Loading