Fix authentication

c7d7ff3e85 broke it
This commit is contained in:
flan 2017-10-29 19:29:46 +01:00
parent 3f3e2f4df4
commit 3792c89ecb
2 changed files with 8 additions and 8 deletions

View File

@ -120,7 +120,7 @@ class SqliteUserManager(SimpleUserManager):
logging.info("Changed password for user {}.".format(username))
def authenticate_user(self, username, password):
def authenticate(self, username, password):
"""Returns True if this username is allowed to connect with this password. False otherwise."""
conn = sqlite.connect(self.auth_db_path)

View File

@ -146,15 +146,15 @@ class SqliteUserManagerTest(unittest.TestCase):
self.user_manager._create_user_dir(username)
self.assertTrue(os.path.isdir(expected_dir_path))
def test_authenticate_user(self):
def test_authenticate(self):
username = "my_username"
password = "my_password"
self.user_manager.create_auth_db()
self.user_manager.add_user(username, password)
self.assertTrue(self.user_manager.authenticate_user(username,
password))
self.assertTrue(self.user_manager.authenticate(username,
password))
def test_set_password_for_user(self):
username = "my_username"
@ -165,8 +165,8 @@ class SqliteUserManagerTest(unittest.TestCase):
self.user_manager.add_user(username, password)
self.user_manager.set_password_for_user(username, new_password)
self.assertFalse(self.user_manager.authenticate_user(username,
password))
self.assertTrue(self.user_manager.authenticate_user(username,
new_password))
self.assertFalse(self.user_manager.authenticate(username,
password))
self.assertTrue(self.user_manager.authenticate(username,
new_password))