Removed skipIf and fixed failing test#214
Open
dnlzrgz wants to merge 2 commits intodjango-cms:masterfrom
Open
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves version-dependent @skipIf decorators from snippet-related tests so they always run, and updates the versioning admin list_display test to match the current ExtendedIndicatorVersionAdminMixin-based implementation and dynamic indicator field behaviour. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The assertions in
test_admin_list_display_with_versioningabout the exact base class tuple(ExtendedIndicatorVersionAdminMixin, admin.ModelAdmin)tightly couple the test to the current inheritance order; consider usingissubclass/isinstancechecks or asserting presence instead of exact tuple equality to make the test more robust to internal refactors. - Similarly, asserting
indicator_field.__name__ == "indicator"intest_admin_list_display_with_versioningmakes the test sensitive to a purely internal naming detail; you could instead assert on behavior (e.g., that the callable is present in the expected position and returns the right value for a sample object) to reduce brittleness.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The assertions in `test_admin_list_display_with_versioning` about the exact base class tuple `(ExtendedIndicatorVersionAdminMixin, admin.ModelAdmin)` tightly couple the test to the current inheritance order; consider using `issubclass`/`isinstance` checks or asserting presence instead of exact tuple equality to make the test more robust to internal refactors.
- Similarly, asserting `indicator_field.__name__ == "indicator"` in `test_admin_list_display_with_versioning` makes the test sensitive to a purely internal naming detail; you could instead assert on behavior (e.g., that the callable is present in the expected position and returns the right value for a sample object) to reduce brittleness.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Description
Removed
@skipIf(cms_version)decorators and unnecessary imports. I also fixed a test that failed after removing the decorator (test_admin.SnippetAdminTestCase.test_admin_list_display_with_versioning).Related resources
@skipIf(cms_version)conditions — CMS <4.1 tests removed from CI #212Checklist
masterDiscord to find a “pr review buddy” who is
going to review my pull request.