def test_output_contains_uuid(self):
     new_name = unique_upload({}, self.filename)
     uuid, ext = new_name.split(".")
     validation_uuid = UUID(uuid, version=4)
     self.assertEqual(str(validation_uuid), uuid)
 def test_output_contains_original_extension(self):
     new_name = unique_upload({}, self.filename)
     uuid, ext = new_name.split(".")
     self.assertEqual(ext, self.original_ext)
Beispiel #3
0
def file_upload(instance, filename):  # zaki's unique upload function
    return unique_upload(instance, filename)
Beispiel #4
0
def file_upload(instance, filename):
    return 'images/' + unique_upload(instance, filename)
Beispiel #5
0
def file_upload(instance, filename):
    return unique_upload(instance, filename)
 def test_output_contains_original_extension(self):
     new_name = unique_upload({}, self.filename)
     uuid, ext = new_name.split(".")
     self.assertEqual(ext, self.original_ext)
 def test_output_contains_uuid(self):
     new_name = unique_upload({}, self.filename)
     uuid, ext = new_name.split(".")
     validation_uuid = UUID(uuid, version=4)
     self.assertEqual(str(validation_uuid), uuid)