Skip to content
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

[#948] Harden fetch_roles_for_case_and_bsn() to work with e-Suite #354

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

Bartvaderkin
Copy link
Contributor

e-Suite doesn't support query on both zaak and BSN

e-Suite doesn't support query on both zaak and BSN
Comment on lines 269 to +275
m.get(
f"{ZAKEN_ROOT}rollen?zaak={self.zaak['url']}&omschrijvingGeneriek={RolOmschrijving.initiator}",
json=paginated_response([self.role]),
f"{ZAKEN_ROOT}rollen?zaak={self.zaak['url']}",
json=paginated_response([self.user_role, self.not_our_user_role]),
)
m.get(
f"{ZAKEN_ROOT}rollen?zaak={self.zaak['url']}&betrokkeneIdentificatie__natuurlijkPersoon__inpBsn={self.user.bsn}",
json=paginated_response([self.role]),
f"{ZAKEN_ROOT}rollen?zaak={self.zaak['url']}&omschrijvingGeneriek={RolOmschrijving.initiator}",
json=paginated_response([self.user_role]),
Copy link
Contributor Author

@Bartvaderkin Bartvaderkin Dec 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learning moment: requests.mocker matches on partial URLs, and in reverse order:

After making my initial changes to remove the BSN parameter I also I had to move the mock with both zaak and omschrijving below the one with only a zaak or it would always return the one with only zaak even if my request had the omschrijving parameter.

@Bartvaderkin Bartvaderkin marked this pull request as ready for review December 1, 2022 14:16
Copy link
Member

@alextreme alextreme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets try this out, I've let Andy know about hitting this limitation in e-Suite so this might be a workaround we can remove in the future.

@alextreme alextreme merged commit 98b592e into develop Dec 1, 2022
@alextreme alextreme deleted the fix/948-esuite-zaak-bsn-roles-query branch December 1, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants