Adds test case for studio_metadata_mixin class#248
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds unit tests covering VideoBlock.editable_metadata_fields behavior in StudioMetadataMixin, validating field transformations, licensing behavior, and English transcript enrichment via services.
Changes:
- Introduces a new Django
SimpleTestCasesuite foreditable_metadata_fields - Adds helpers for constructing a
VideoBlockand mocking runtime/services - Covers default field modifications, licensing on/off, and transcript merge behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code ReviewOverviewThis PR adds the first dedicated unit test file for The overall structure is clean and the intent is well-communicated. A few gaps and style points worth addressing before merge. What Works Well
Issues & SuggestionsMedium — Missing edge cases
Medium — Test does two things
Minor — Style / coupling
Summary
Good foundational PR — the happy paths and primary error path are all covered. The main asks before merge are: test |
The editable_metadata_fields property had no dedicated tests, leaving its field-level transformations (type overrides, sub removal, transcript language injection, license toggling, English transcript merging via video_config service) unverified during XBlock extraction from edx-platform. Adds TestEditableMetadataFieldsProperty covering: - Default field modifications (sub removal, type overrides for transcripts/edx_video_id/handout, urlRoot, public_access) - Transcripts value passthrough and public_access URL enrichment - License removal/retention based on settings service licensing_enabled - License retention when no settings service is present - English transcript lookup via video_config (found, merged, not found) Uses DummyRuntime (no XModuleMixin) to exercise the block in its extracted form. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6b992db to
177ed85
Compare
Ticket: #197 (comment)
The editable_metadata_fields property on VideoBlock had no dedicated tests, leaving its field-level
transformations (type overrides, transcript language injection, license toggling, English transcript
merging) unverified during the XBlock extraction from edx-platform.
This PR adds:
language list injection)
TranscriptNotFoundError handling