Exemple #1
0
    def test_check_user(self):
        '''
		Function to test whether the login in function check_user works as expected
		'''
        self.new_user = User('fanny', 'usanase', 'fa100')
        self.new_user.save_user()
        user2 = User('mimi', 'mutoni', 'mi00')
        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,
            Credential.check_user(user2.password, user2.first_name))
def verify_user(first_name, password):
    '''
    function that verifies the existance of user
    '''
    checking_user = Credential.check_user(first_name, password)
    return checking_user