Make metadata field tests more permissive#441
Merged
Conversation
- Add CldTestCase.assertObjectContainsSubset for recursive dict-subset assertions, allowing the server to return extra keys. - Use it in metadata field assertions so added restriction defaults (hidden_ui, excluded_from_search) no longer fail the test. - Drop the conflicting mandatory+readonly combination in the update test (server rejects it) while keeping restrictions coverage. - Reuse the helper across metadata reorder and uploader tests. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Add Python 3.14 and Django 5.2 LTS / 6.0. - Drop EOL Python 3.9 and Django 3.2. - Pin django60 to Python 3.12+ (its minimum) in the matrix. - Update classifiers in setup.py and pyproject.toml to match. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two failing metadata field tests caused by server-side behavior changes, and makes the assertions more permissive against future additions.
test05_create_date_metadata_fieldwas failing because the server now returns extra default keys in therestrictionsobject (hidden_ui,excluded_from_search) alongside the requestedreadonly_ui. The test did an exact-equality check.test08_update_metadata_fieldwas failing with400 - Cannot have both mandatory and readonly fields set; the test sentmandatory: Truetogether withrestrictions: {readonly_ui: True}, which the server now rejects.Changes
CldTestCase.assertObjectContainsSubset(actual, expected)— a recursive dict-subset assertion that allowsactualto contain extra keys (no built-in covers the nested case).assert_metadata_field, so added restriction defaults no longer break the test.mandatoryfrom the update test while keepingrestrictionscoverage (the unique behavior that test exercises).Test plan
python3 -m pytest test/test_metadata.py test/test_uploader.py --collect-onlycollects cleanly.@skipUnless(api_secret)integration tests, exercised in CI where credentials are present.🤖 Generated with Claude Code