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

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

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