def test_check_user(self):
        '''
        Test case to test whether login feature is functional.
        '''
        self.new_user = User('Monica', 'Oyugi', 'ndito123')
        self.new_user.save_user()
        user2 = User('Martin', 'Owiti', '@#Omosh')
        user2.save_user()

        for user in User.users_list:
            if user.first_name == user2.first_name and user.password == user2.password:
                current_user = user.first_name
        return current_user

        self.assertEqual(current_user,
                         User.check_user(user2, password, user2.first_name))
예제 #2
0
    def test_check_user(self):
        '''
        Test case to test whether login feature is functional.
        '''
        self.new_user = User('Brian', 'Major', 'dead2016')
        self.new_user.save_user()
        user2 = User('Machel', 'Nyanumba', 'moringa19')
        user2.save_user()

        for user in User.users_list:
            if user.first_name == user2.first_name and user.password == user2.password:
                current_user = user.first_name
        return current_user

        self.assertEqual(current_user,
                         User.check_user(user2.password, user2.first_name))
예제 #3
0
def verify_user(first_name, password):
    '''
    Function that verifies if user exists.
    '''
    checking_user = User.check_user(first_name, password)
    return checking_user