Пример #1
0
 def test_file_id_wrong_data_type(self):
     # Test using bytes instead of str
     file_id = six.ensure_binary(_get_file_id())
     self.assertFalse(
         FilepondFileUploader._file_id_valid(file_id),
         ('The provided file ID is of the wrong data type, this test '
          'should fail.'))
Пример #2
0
 def test_file_id_invalid(self):
     file_id = 'sadadadasd'
     self.assertFalse(
         FilepondFileUploader._file_id_valid(file_id),
         'Invalid file ID (wrong length) provided. Failure expected.')
Пример #3
0
 def test_file_id_valid(self):
     file_id = _get_file_id()
     self.assertTrue(
         FilepondFileUploader._file_id_valid(file_id),
         'A valid file ID has been provided and this test should pass!')