Skip to content

Adds test case for studio_metadata_mixin class#248

Open
farhan wants to merge 3 commits into
mainfrom
farhan/add-unit-test-video-block
Open

Adds test case for studio_metadata_mixin class#248
farhan wants to merge 3 commits into
mainfrom
farhan/add-unit-test-video-block

Conversation

@farhan
Copy link
Copy Markdown
Contributor

@farhan farhan commented May 13, 2026

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:

  • A new test_studio_metadata_mixin.py test file covering VideoBlock.editable_metadata_fields
  • Tests for default field modifications (sub removal, transcripts/edx_video_id/handout type overrides,
    language list injection)
  • Tests for license field removal/retention based on the settings service's licensing_enabled flag
  • Tests for English transcript lookup via the video_config service, including merge-with-existing and
    TranscriptNotFoundError handling
  • Uses DummyRuntime (no XModuleMixin) to ensure the block is exercised in its extracted form

…_studio_metadata_mixin

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan farhan removed the status in Aximprovements Team May 15, 2026
@farhan farhan moved this to 🏗 In progress in Aximprovements Team May 18, 2026
- Consolidate 8 single-assertion methods into fewer grouped tests
- Extract _service_stub helper to eliminate repeated inline lambdas
- Extend _get_fields with service param to replace verbose patch blocks
- Add missing merge-case test for English transcript + existing transcripts
@farhan farhan marked this pull request as ready for review May 18, 2026 10:36
@farhan farhan moved this from 🏗 In progress to 👀 In review in Aximprovements Team May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

1 participant