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)
def file_upload(instance, filename): # zaki's unique upload function return unique_upload(instance, filename)
def file_upload(instance, filename): return 'images/' + unique_upload(instance, filename)
def file_upload(instance, filename): return unique_upload(instance, filename)