-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#911] Added 'indicatieInternOfExtern' access check, also refactored cases-views tests #394
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #394 +/- ##
========================================
Coverage 96.10% 96.10%
========================================
Files 462 462
Lines 15056 15082 +26
========================================
+ Hits 14469 14494 +25
- Misses 587 588 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
74d0935
to
7cac73a
Compare
…cases-views tests Refactoring tests was about casing issue in generate_oas_component() mocks, using setUpTestData(), ClearCachesMixin and use of URLs instead of links
7cac73a
to
c9888fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I am concerned, I don't see something weird. Only a small comment-question.
# resolve case-type | ||
self.case.zaaktype = fetch_single_case_type(self.case.zaaktype) | ||
if not self.case.zaaktype: | ||
return self.handle_no_permission() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is done for readability purposes but we have five times the same return statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, to keep the decision procedure more readable (without adding extra noisy workarounds) it just returns after every failed condition.
Note: the important change was to
is_zaak_visible()
Then I found this wasn't applied to the list-views at all, and that required a refactor because we needed the filtering before the pagination which required to move the zaaktype retrieval code around.
But then I found the issue with the property casing in the mocks, and some other test noise like the cache-reset mixin and test data setup.
As a bonus: less noisy UserFactory, and improved ZGW api_model dataclass annotations that support swapping link URI's to objects because that is how it was used.