diff --git a/helpdesk/tests/test_attachments.py b/helpdesk/tests/test_attachments.py index d7bd2c5b..e9e4909c 100644 --- a/helpdesk/tests/test_attachments.py +++ b/helpdesk/tests/test_attachments.py @@ -100,7 +100,7 @@ class AttachmentUnitTests(TestCase): ) ) - @mock.patch('helpdesk.lib.FollowUpAttachment', autospec=True) + @mock.patch('models.FollowUpAttachment', autospec=True) def test_unicode_attachment_filename(self, mock_att_save, mock_queue_save, mock_ticket_save, mock_follow_up_save): """ check utf-8 data is parsed correctly """ filename, fileobj = lib.process_attachments(self.follow_up, [self.test_file])[0] @@ -113,8 +113,7 @@ class AttachmentUnitTests(TestCase): ) self.assertEqual(filename, self.file_attrs['filename']) - @mock.patch('helpdesk.lib.FollowUpAttachment', autospec=True) - def test_autofill(self, mock_att_save, mock_queue_save, mock_ticket_save, mock_follow_up_save): + def test_autofill(self, mock_att_save, mock_queue_save, mock_ticket_save): """ check utf-8 data is parsed correctly """ obj = models.FollowUpAttachment.objects.create( followup=self.follow_up, @@ -147,7 +146,6 @@ class AttachmentUnitTests(TestCase): self.assertEqual(obj.size, len(self.file_attrs['content'])) self.assertEqual(obj.mime_type, "text/plain") - # @mock.patch.object('helpdesk.lib.FollowUpAttachment', 'save', autospec=True) @override_settings(MEDIA_ROOT=MEDIA_DIR) def test_unicode_filename_to_filesystem(self, mock_att_save, mock_queue_save, mock_ticket_save, mock_follow_up_save): """ don't mock saving to filesystem to test file renames caused by storage layer """