-
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
[#2274] Pass data in Haalcenntraal POST as JSON #1145
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1145 +/- ##
========================================
Coverage 95.07% 95.07%
========================================
Files 948 949 +1
Lines 33556 33574 +18
========================================
+ Hits 31903 31921 +18
Misses 1653 1653 ☔ View full report in Codecov by Sentry. |
1562055
to
dc4d178
Compare
dc4d178
to
4c25c7d
Compare
"burgerservicenummer": ["999993847"], | ||
} | ||
|
||
self.assertEqual(response.request.body, json.dumps(data).encode("utf-8")) |
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.
While this works for now I'd like to note I would've gone the other way: JSON parse the request body and compare it to the expected dict.
JSON serialization is technically not 100% stable (there are multiple valid JSON strings possible for the same data, because of dict ordering and pretty pretting), and in the assertion you'd get a structural diff instead of a text diff.
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.
Good point!
4c25c7d
to
1bbba84
Compare
"burgerservicenummer": ["999993847"], | ||
} | ||
|
||
self.assertEqual(json.loads(response.request.body), data) |
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.
this could have used response.json
, but I'll approve to get this merged for the release
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.
Agreed, feels unnecessary
Taiga: #2274