Skip to content

Commit

Permalink
Test users_ldap_groups: add assertRaises(UnicodeDecodeError)
Browse files Browse the repository at this point in the history
  • Loading branch information
oh2fih committed Mar 29, 2024
1 parent 645430c commit 656c806
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions users_ldap_groups/tests/test_users_ldap_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,14 @@ def _test_users_ldap_groups_ldap_returns_binary_data(self):
}
),
), mock_cursor(self.cr):
user_id = (
self.env["res.users"]
.sudo()
.authenticate(
self.env.cr.dbname, "users_ldap_groups-username", "password", {}
with self.assertRaises(UnicodeDecodeError):
user_id = (
self.env["res.users"]
.sudo()
.authenticate(
self.env.cr.dbname, "users_ldap_groups-username", "password", {}
)
)
)
# this asserts group mappings from demo data
user = self.env["res.users"].sudo().browse(user_id)
groups = user.groups_id
Expand Down

0 comments on commit 656c806

Please sign in to comment.