Honor validated registration usernames
This commit is contained in:
parent
83508915db
commit
0be8a03b99
2 changed files with 16 additions and 2 deletions
|
|
@ -19,6 +19,13 @@ class ProvisionerTests(unittest.TestCase):
|
|||
def test_username_is_stable_and_sanitized(self):
|
||||
self.assertEqual("bernd.worsch", _username("Bernd.Worsch@binky-hedgehog.com"))
|
||||
|
||||
def test_preferred_username_is_honored_and_validated(self):
|
||||
self.assertEqual("chosen.name", _username("other@example.test", "Chosen.Name"))
|
||||
with self.assertRaisesRegex(ValueError, "invalid"):
|
||||
_username("other@example.test", "not allowed!")
|
||||
with self.assertRaisesRegex(ValueError, "reserved"):
|
||||
_username("other@example.test", "admin")
|
||||
|
||||
def test_dispatch_requires_idempotency(self):
|
||||
with self.assertRaisesRegex(ValueError, "idempotency_key"):
|
||||
dispatch(Fake(), "/v1/identities/suspend", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue