Example #1
0
def verify_user(first_name, password):
    """
    Function that verifies the existance of the user before creating credentials
    :param first_name:
    :param password:
    :return:
    """
    checking_user = Credential.check_user(first_name, password)
    return checking_user
Example #2
0
    def test_check_user(self):
        self.new_user = User('Dancan', 'Od\'uo\'r', '28750187')
        self.new_user.save_user()
        user2 = User('Ben', 'Od\'uo\'r', '28750187')
        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
        self.assertEqual(
            current_user,
            Credential.check_user(user2.password, user2.first_name))
        return current_user
Example #3
0
	def test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User("Eve","evelyne","pswd100")
		self.new_user.save_user()
		user2 = User("Aggy","agnes","pswd200")
		user2.save_user()

		for user in User.user_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))
Example #4
0
    def test_check_user(self):
        '''
        Test to check if users login works as it is suppossed to
        '''
        self.new_user = User('Tabby','Wanjiku' ,'twpd254')
        self.new_user.save_user()
        user2 = User('Nicky' ,'Wanjiku',  'twpd254')
        user2.save_user()

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

        self.assertEqual(current_user ,Credential.check_user(user2.password ,user2.first_name))
	def test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User('David','Ngugi,'pswd-1')
		self.new_user.save_user()
		user2 = User('Samuel','Qinuh,'pswd-1')
		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))
Example #6
0
	def test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User('Bernice','Twili','1234')
		self.new_user.save_user()
		user2 = User('Kaylin','Ella','5678')
		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))
Example #7
0
	def test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User('dominic','rutto,'pass33')
		self.new_user.save_user()
		user2 = User('ken','asati,'pass33')
		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))
Example #8
0
    def test_check_user(self):
        '''
		Function to test whether the login in function check_user works as expected
		'''
        self.new_user = User('peter', 'Ng\'ang\'a', 'pswd100')
        self.new_user.save_user()
        user2 = User('Ken', 'Ng\'ang\'a', 'pswd100')
        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 test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User('Miriam','pswd4363')
		self.new_user.save_user()
		user2 = User('philip','pswd4363')
		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))

		Credential.credentials_list.append(self)
    def test_check_user(self):
        '''
        Function to test whether the login in function check_user works as expected
        '''
        self.new_user = User('Ibrahim', 'Hassib', 'McGee')
        self.new_user.save_user()
        user2 = User('Loso', 'Wii', 'psd001')
        user2.save_user()

        for user in User.user_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 test_check_user(self):
        '''
		Function to test whether the login in function check_user works as expected
		'''
        self.new_user = User('Stephen', 'Ndele', 'ndele')
        self.new_user.save_user()
        user2 = User('mark', 'luke', 'john')
        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))
        class TestCredentials(unittest.TestCase):
	'''
	Test class that defines test cases for the credentials class behaviours.
	Args:
	    unittest.TestCase: helps in creating test cases
	'''
	def test_check_user(self):
		'''
		Function to test whether the login in function check_user works as expected
		'''
		self.new_user = User('Loise','Ki\'Me\'u','password000')
		self.new_user.save_user()
		user2 = User('Jam','Ma\'ye\'ye','password001')
		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))
Example #13
0
def verify_user(first_name, password):
    '''
	Function that ensures the existance of the user before creating credentials
	'''
    checking_user = Credential.check_user(first_name, password)
    return checking_user
Example #14
0
def verify_user(first_name, password):
    '''
    function that verifys login info
    '''
    checking_user = Credential.check_user(first_name, password)
    return checking_user
Example #15
0
def verify_user(first_name,password):
	'''
	Function that verifies  an account before creating credentials
	'''
	checking_user = Credential.check_user(first_name,password)
	return checking_user
Example #16
0
def verify_user(first_name, password):
    '''
    Function that verifies if a user exists before creating a credential account
    '''
    checking_user = Credential.check_user(first_name, password)
    return checking_user
Example #17
0
def verify_user(first_name, password):
    checking_user = Credential.check_user(first_name, password)
    return checking_user