summaryrefslogtreecommitdiff
path: root/service/test/unit/test_authentication.py
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-10-26 15:31:23 +0200
committerDenis Costa <deniscostadsc@gmail.com>2016-10-26 14:34:31 -0200
commit3df56a4f3c411c3bde51c88e6e0bf34d5e582119 (patch)
treede4f9a2d1d78d8868d49998fc2a91ea1b5cc3d83 /service/test/unit/test_authentication.py
parente3006fff2f71787e9879e2f88e57dc9b935b7782 (diff)
extracting username before doing bonafide auth #795
Diffstat (limited to 'service/test/unit/test_authentication.py')
-rw-r--r--service/test/unit/test_authentication.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/service/test/unit/test_authentication.py b/service/test/unit/test_authentication.py
index f9f98af9..cebb6543 100644
--- a/service/test/unit/test_authentication.py
+++ b/service/test/unit/test_authentication.py
@@ -33,6 +33,13 @@ class AuthenticatorTest(unittest.TestCase):
with self.assertRaises(UnauthorizedLogin):
yield auth.authenticate('username', 'password')
+ @inlineCallbacks
+ def test_auth_username_with_domain_only_makes_bonafide_auth_with_username(self):
+ auth = Authenticator(self._leap_provider)
+ with patch('pixelated.authentication.authenticate') as mock_leap_authenticate:
+ yield auth.authenticate('username@domain.org', 'password')
+ mock_leap_authenticate.assert_called_once_with(self._leap_provider, 'username', 'password')
+
def test_validate_username_accepts_username(self):
auth = Authenticator(self._leap_provider)
self.assertTrue(auth.validate_username('username'))