def test_set_user_id_by_username_valid(self): read_user_helper = PADSUserHelper() read_user_helper.set_user_id_by_username(self.username) # Assertion self.assertEquals( read_user_helper.user_id, self.user.id, 'A User Helper must be able to be assigned to a registered user')
def test_check_ql_password_no_user(self): read_user_helper_orphan = PADSUserHelper() # Assertions check = read_user_helper_orphan.check_ql_password(self.ql_password) self.assertFalse( check, 'A User Helper with no User must fail to validate passwords')
def setUpTestData(cls): # Set Up User Helpers read_user_helper = PADSUserHelper() write_user_helper = PADSWriteUserHelper() # Sign Up Test Quick List User ql_password = write_user_helper.new() cls.ql_user_id = read_user_helper.split_ql_password(ql_password)[0] cls.ql_user = PADSUser.objects.get(pk=cls.ql_user_id)
def test_set_user_id_by_username_blank_input(self): read_user_helper_i2 = PADSUserHelper() # Mult-Assertion for i in blank_inputs: read_user_helper_i2.set_user_id_by_username(i) self.assertEquals( read_user_helper_i2.user_id, settings['user_id_signed_out'], 'User Helper cannot be assigened a User following blank input') self.assertFalse( read_user_helper_i2.user_is_present(), 'User Helper must indicate it failed to set username')
def test_set_user_id_by_username_invalid(self): read_user_helper_i = PADSUserHelper() random_username = secrets.token_urlsafe( settings['message_max_length_short']) read_user_helper_i.set_user_id_by_username(random_username) # Assertions self.assertEquals( read_user_helper_i.user_id, settings['user_id_signed_out'], 'A User Helper cannot be assigned a User without a valid username') self.assertFalse( read_user_helper_i.user_is_present(), 'User Helper must indicate failure setting invalid user by username' )
def setUpTestData(cls): # Sign Up Quick List User write_user_helper = PADSWriteUserHelper() cls.ql_password = write_user_helper.new() # Prepare User Helper for Test QL User cls.read_user_helper = PADSUserHelper() cls.ql_user_id = cls.read_user_helper.split_ql_password( cls.ql_password)[0] cls.read_user_helper.set_user_id(cls.ql_user_id)
def setUpTestData(cls): # Sign up test User cls.username = '******' cls.password = '******' cls.write_user_helper = PADSWriteUserHelper() cls.write_user_helper.new(cls.username, cls.password) # Prepare User Helper for test User cls.read_user_helper = PADSUserHelper() cls.read_user_helper.set_user_id_by_username(cls.username)
def setUpTestData(cls): cls.write_user_helper = PADSWriteUserHelper() cls.read_user_helper = PADSUserHelper()