-
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
🗃️ [#2041] Added hard database constraints on User's identifier/login_type fields #1074
base: develop
Are you sure you want to change the base?
Conversation
8b236ff
to
edc7d43
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1074 +/- ##
===========================================
+ Coverage 95.03% 95.04% +0.01%
===========================================
Files 911 913 +2
Lines 32038 32124 +86
===========================================
+ Hits 30446 30532 +86
Misses 1592 1592 ☔ View full report in Codecov by Sentry. |
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.
Not sure if something needs to be done about DuplicateEmailRegistrationTest
; take a quick look to confirm.
@@ -442,6 +443,9 @@ def test_form_success_with_api_eherkenning_user(self, m): | |||
with self.subTest( | |||
use_rsin_for_innNnpId_query_parameter=use_rsin_for_innNnpId_query_parameter | |||
): | |||
# FIXME for some reason creating the user outside of the loop | |||
# makes the second iteration fail? | |||
User.objects.filter(kvk="12345678").delete() |
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.
Same/similar issue as in https://github.com/maykinmedia/open-inwoner/blob/develop/src/open_inwoner/accounts/tests/test_profile_views.py#L547, where the mock has to be recreated because it is overriden somehow? Something's up with our mock machinery that needs to be fixed, though not sure if this can be done as part of your ticket; perhaps create a new one for this.
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.
Agree these delete()'s are a bit smelly.
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.
Still unsure why only the second iteration failed: apparently it wasn't due to the mocks, but it's fixed if I give the User
the same email
as the klant
created in the mock data? 🙈
edc7d43
to
7048b7f
Compare
7048b7f
to
8f3f271
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.
Some small notes, and I wonder if we covered the eenmanszaken situation from an earlier comment (if we always have kvk and rsin, or if eenmanszaken can have a bsn but not kvk or rsin).
8f3f271
to
67c28a6
Compare
67c28a6
to
5508218
Compare
# reset noise from signals | ||
m.reset_mock() | ||
self.clearTimelineLogs() |
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.
We don't need these lines anymore as they were there to reset the subtests.
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 removed the reset_mock
, but clearTimelineLogs
is actually still needed (it's also used in other tests in this file that don't have subtests)
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.
Existing code may or may not be perfect.
Could be cool to see why it happens but if you tested it fails if we remove it I'll believe it (could be because the code earlier in the tests generates similar logs)
# reset noise from signals | ||
m.reset_mock() | ||
self.clearTimelineLogs() |
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.
Same as above
5508218
to
39a45be
Compare
@stevenbal Are we sure about the |
I'll double check with Alex, apparently Groningen registers eenmanszaken bij KVK number and vestigingsnummer, but if we only allow that, it would still not work for eenmanszaken if we use Open Zaak. In case of Open Zaak we might have to force users that want to log in for an eenmanszaak to log in with DigiD |
The suggestion (OpenZaak + RSIN + eHerkenning -> dont allow eenmanszaken to log in via eHerkenning) is sufficient for now and is already in the project. For eenmanszaken BSN == RSIN, so logging in via DigiD would give them the same information. |
39a45be
to
2b8b97c
Compare
@Bartvaderkin I rebased this on master, can you re-review/approve this? :) |
@swrichards could you take a look at this PR somewhere in the following weeks? No rush but now it is languishing |
👍 |
Based on #990