Ejemplo n.º 1
0
    def test_file_valid_mode(self, Image):
        mock_image = _save_image(mode='ABC')

        mock_image.convert.assert_called_with('RGB')
Ejemplo n.º 2
0
 def test_file_upload_failure(self):
     with self.assertRaises(Exception):
         _save_image(format='MP3')
Ejemplo n.º 3
0
    def test_file_upload_success(self, Image):
        mock_image = _save_image()

        self.assertEqual(mock_image.format, 'PNG')
        mock_image.thumbnail.assert_called_with((140, 140), 1)
Ejemplo n.º 4
0
    def test_file_valid_mode(self, Image):
        mock_image = _save_image(mode='ABC')

        mock_image.convert.assert_called_with('RGB')
Ejemplo n.º 5
0
 def test_file_upload_failure(self):
     with self.assertRaises(Exception):
         _save_image(format='MP3')
Ejemplo n.º 6
0
    def test_file_upload_success(self, Image):
        mock_image = _save_image()

        self.assertEqual(mock_image.format, 'PNG')
        mock_image.thumbnail.assert_called_with((140, 140), 1)