-
-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[18.0][MIG] auth_saml: Migration to 18.0
- Loading branch information
Showing
7 changed files
with
86 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ def test__compute_sp_metadata_url__provider_has_sp_baseurl(self): | |
{"p": self.saml_provider.id, "d": self.env.cr.dbname} | ||
) | ||
expected_url = urllib.parse.urljoin( | ||
"http://example.com", f"/auth_saml/metadata?{expected_qs}" | ||
"http://example.com", (f"/auth_saml/metadata?{expected_qs}") | ||
) | ||
# Assert that sp_metadata_url is set correctly | ||
self.assertEqual(self.saml_provider.sp_metadata_url, expected_url) | ||
|
@@ -332,16 +332,14 @@ def test_disallow_user_password_no_password_set(self): | |
with self.assertRaises(ValidationError): | ||
user.password = "new password" | ||
|
||
def test_disallow_user_password(self): | ||
def test_disallow_user_password_on_option_disable(self): | ||
"""Test that existing user password is deleted when adding an SAML provider when | ||
the disallow option is set.""" | ||
self.authenticate(user="[email protected]", password="Lu,ums-7vRU>0i]=YDLa") | ||
# change the option | ||
self.browse_ref( | ||
"auth_saml.allow_saml_uid_and_internal_password" | ||
).value = "False" | ||
# Test that existing user password is deleted when adding an SAML provider | ||
self.authenticate(user="[email protected]", password="Lu,ums-7vRU>0i]=YDLa") | ||
self.add_provider_to_user() | ||
with self.assertRaises(AccessDenied): | ||
self.authenticate(user="[email protected]", password="Lu,ums-7vRU>0i]=YDLa") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters