mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
19 lines
629 B
Python
19 lines
629 B
Python
from galaxy.auth.providers.alwaysreject import AlwaysReject
|
|
from galaxy.auth.providers.localdb import LocalDB
|
|
from galaxy.model import User
|
|
|
|
|
|
def test_alwaysreject():
|
|
t = AlwaysReject()
|
|
assert t.authenticate('testmail', 'testuser', 'secret', dict()) == (None, '', '')
|
|
|
|
|
|
def test_localdb():
|
|
user = User(email='testmail', username='tester')
|
|
user.set_password_cleartext('test')
|
|
t = LocalDB()
|
|
reject = t.authenticate_user(user, 'wrong', {'redact_username_in_logs': False})
|
|
accept = t.authenticate_user(user, 'test', {'redact_username_in_logs': False})
|
|
assert reject is False
|
|
assert accept is True
|