예제 #1
0
 def test_compress_no_compression_software(self, call):
     """compress_image does not fail when no compression software."""
     image = self._uploaded_image()
     compress_image(image, 'file')
     assert not call.called
예제 #2
0
 def test_compressed_image_default(self, call):
     """uploaded animated gif image is not compressed."""
     image = self._uploaded_image(testfile="animated.gif")
     compress_image(image, 'file')
     assert not call.called
예제 #3
0
 def test_compress_no_file(self, call):
     """compress_image does not fail when no file is provided."""
     image = ImageAttachment(content_object=self.obj, creator=self.user)
     compress_image(image, 'file')
     assert not call.called
예제 #4
0
 def test_compressed_image_default(self, call):
     """uploaded image is compressed."""
     image = self._uploaded_image()
     compress_image(image, 'file')
     assert call.called
예제 #5
0
 def test_compress_no_compression_software(self, call):
     """compress_image does not fail when no compression software."""
     image = self._uploaded_image()
     compress_image(image, 'file')
     assert not call.called
예제 #6
0
 def test_compress_no_file(self, call):
     """compress_image does not fail when no file is provided."""
     image = ImageAttachment(content_object=self.obj, creator=self.user)
     compress_image(image, 'file')
     assert not call.called
예제 #7
0
 def test_compressed_image_default(self, call):
     """uploaded image is compressed."""
     image = self._uploaded_image()
     compress_image(image, 'file')
     assert call.called