Example #1
0
 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')
Example #2
0
 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')
Example #3
0
 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)
Example #4
0
 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')
Example #5
0
 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'
     )
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 def setUpTestData(cls):
     cls.write_user_helper = PADSWriteUserHelper()
     cls.read_user_helper = PADSUserHelper()