Exemple #1
0
    def test_file_valid_mode(self, Image):
        mock_image = _save_image(mode='ABC')

        mock_image.convert.assert_called_with('RGB')
Exemple #2
0
 def test_file_upload_failure(self):
     with self.assertRaises(Exception):
         _save_image(format='MP3')
Exemple #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)
Exemple #4
0
    def test_file_valid_mode(self, Image):
        mock_image = _save_image(mode='ABC')

        mock_image.convert.assert_called_with('RGB')
Exemple #5
0
 def test_file_upload_failure(self):
     with self.assertRaises(Exception):
         _save_image(format='MP3')
Exemple #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)