Exemplo n.º 1
0
def authentication(first_name, password):
    '''
    function to authenticate a user that they have an account
    '''

    authenticate_user = Credential.authenticate_user(first_name, password)
    return authenticate_user
Exemplo n.º 2
0
    def test_authenticate_user(self):
        '''
        Function to check whether authenicate_user is working properly
        '''

        self.new_user = User("badar", "badar124")
        self.new_user.save_user()
        another_user = User("salax", "salaax234")
        another_user.save_user()

        for user in User.user_list:
            if user.first_name == another_user.first_name and user.password == another_user.password:
                current_user = user.first_name
        return current_user

        self.assertEqual(
            current_user,
            Credential.authenticate_user(another_user.password,
                                         another_user.first_name))