def verify_user(user_name, password): ''' Ensures that a user has created an account before the can log in ''' finding_user = User.find_user(user_name, password) return finding_user
def test_find_user(self): ''' Test case to check test whether a user can only login once they have created an account ''' self.new_user.save_user() test_user = User("Muthoni", "pass@word") test_user.save_user() for user in User.users_list: if user.user_name == test_user.user_name and user.password == test_user.password: current_user = user.user_name return current_user self.assertEqual( current_user, User.find_user(test_user.password, test_user.user_name))