def verify_user(first_name, password): ''' Function that verifies the existance of the user before creating credentials ''' checking_user = Credential.check_user(first_name, password) return checking_user
def test_check_user(self): self.new_user = User('Jane','11111') self.new_user.save_user() user2 = User('John','222222') user2.save_user() for user in User.user_list: if user.username == user2.username and user.password == user2.password: current_user = user.username return current_user self.assertEqual(current_user,Credential.check_user(user2.password,user2.username))
def test_check_user(self): ''' Function to test whether the login in function check_user works as expected ''' self.new_user = User('Christian','Jire','21','pwd123456') self.new_user.save_user() user2 = User('Chase','Lorde',22,'pw123456') 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("carl","Kami", "xyz") self.new_user.save_user() user_x = User("carl","koy","xyz") user_x.save_user() for user in User.users_list: if user.first_name == user_x.first_name and user.password == user_x.password: current_user = user.first_name return current_user self.assertEqual(current_user,Credential.check_user(user_x.password,user_x.first_name))
def test_check_user(self): ''' Function to test whether the login in function check_user works as expected ''' self.new_user = User('antony','mwa\'nik\'a','pswd3250') self.new_user.save_user() user2 = User('antony','mwa\'nik\'i','pswd3250') 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('David', 'Mumo', 'Msyoka!') self.new_user.save_user() user2 = User('slime', 'Mumo', 'Msyoka!') 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('Jeanne', 'NYIRAMWIZA', 'amahoro1') self.new_user.save_user() user2 = User('Kennedy', 'MUVARA', 'ejo12345') 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): checking_user = Credential.check_user(first_name, password) return checking_user