def verify_user(fname, password): ''' verify if there is already a user before adding details ''' checking_user = Details.check_user(fname, password) return checking_user
def test_check_user(self): ''' checking if the user credentials works ''' self.n_user = User('Ben','Jackson','test01') self.n_user.save_user_details() user2 = User('Joe','Jackson','test01') user2.save_user_details() for user in User.users_list: if user.f_name == user2.f_name and user.password == user2.password: current_user = user.f_name return current_user self.assertEqual(current_user,Details.check_user(user2.password,user2.f_name))