Skip to content

Commit

Permalink
✅ [#1957] Add/fix tests for klant resources for companies
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Jan 4, 2024
1 parent f234d7f commit 8a896de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,10 @@ def register_by_api(self, form, config: OpenKlantConfig):

klant = fetch_klant(**get_fetch_parameters(self.request.user))
if klant:
self.log_system_action(
"retrieved klant for BSN-user", user=self.request.user
)
self.log_system_action("retrieved klant for user", user=self.request.user)
else:
self.log_system_action(
"could not retrieve klant for BSN-user", user=self.request.user
"could not retrieve klant for user", user=self.request.user
)
data = {
"bronorganisatie": config.register_bronorganisatie_rsin,
Expand All @@ -772,7 +770,7 @@ def register_by_api(self, form, config: OpenKlantConfig):
)
else:
self.log_system_action(
"could not create klant for BSN-user", user=self.request.user
"could not create klant for user", user=self.request.user
)

# create contact moment
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/openklant/tests/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_update_user_after_login(self, m):
self.assertEqual(user.email, "[email protected]")
self.assertEqual(user.phonenumber, "0612345678")

self.assertTimelineLog("retrieved klant for BSN-user")
self.assertTimelineLog("retrieved klant for user")
self.assertTimelineLog(
"updated user from klant API with fields: email, phonenumber"
)
Expand Down Expand Up @@ -101,5 +101,5 @@ def test_update_user_after_login_skips_existing_email(self, m):
self.assertEqual(user.email, "[email protected]")
self.assertEqual(user.phonenumber, "0612345678")

self.assertTimelineLog("retrieved klant for BSN-user")
self.assertTimelineLog("retrieved klant for user")
self.assertTimelineLog("updated user from klant API with fields: phonenumber")

0 comments on commit 8a896de

Please sign in to comment.