Skip to content

added unit test with parametrize #724 issue#5563

Open
Scroll07 wants to merge 1 commit into
WordPress:mainfrom
Scroll07:add-unit-tests-issue-724
Open

added unit test with parametrize #724 issue#5563
Scroll07 wants to merge 1 commit into
WordPress:mainfrom
Scroll07:add-unit-tests-issue-724

Conversation

@Scroll07
Copy link
Copy Markdown

Fixes

Fixes #724 by @Scroll07

Description

Added unit tests with pytest.mark.parametrize for media serializers.

  • Implemented parametrize tests in test_media_serializers.py based on AudioFactory/MediaFactory structure.
  • Covers serializer validations and edge cases for ImageFactory.
  • Changes in media_serializers.py for test compatibility.
  • Local pytest passes successfully.

Testing Instructions

  1. pytest api/test/unit/serializers/test_media_serializers.py -v
  2. Verify parametrize runs multiple cases without errors.

Note: CI failed due to environment issues with Elasticsearch, but local tests OK.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog PRs) or the media properties generator (ov just catalog/generate-docs media-props for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

@Scroll07 Scroll07 requested a review from a team as a code owner March 22, 2026 19:10
@Scroll07 Scroll07 requested review from krysal and obulat and removed request for a team March 22, 2026 19:10
@openverse-bot openverse-bot added 🧱 stack: api Related to the Django API 🟨 priority: medium Not blocking but should be addressed soon 🧰 goal: internal improvement Improvement that benefits maintainers, not users 💻 aspect: code Concerns the software code in the repository labels Mar 22, 2026
@openverse-bot openverse-bot moved this to 👀 Needs Review in Openverse PRs Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API

Projects

Status: 👀 Needs Review

Development

Successfully merging this pull request may close these issues.

Add serializer unit tests

2 participants