mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-20 09:37:48 +02:00
Fix a bug I introduced in earlier commit + fix one test
This commit is contained in:
parent
7e5ff05b02
commit
9320df0268
@ -136,7 +136,7 @@ def process_attachments(followup, attached_files):
|
|||||||
|
|
||||||
if attached.size:
|
if attached.size:
|
||||||
filename = smart_text(attached.name)
|
filename = smart_text(attached.name)
|
||||||
att = followup.followupattachment_set(
|
att = followup.followupattachment_set.create(
|
||||||
file=attached,
|
file=attached,
|
||||||
filename=filename,
|
filename=filename,
|
||||||
mime_type=attached.content_type or
|
mime_type=attached.content_type or
|
||||||
|
@ -147,7 +147,7 @@ class AttachmentUnitTests(TestCase):
|
|||||||
self.assertEqual(obj.size, len(self.file_attrs['content']))
|
self.assertEqual(obj.size, len(self.file_attrs['content']))
|
||||||
self.assertEqual(obj.mime_type, "text/plain")
|
self.assertEqual(obj.mime_type, "text/plain")
|
||||||
|
|
||||||
@mock.patch.object(lib.FollowUpAttachment, 'save', autospec=True)
|
@mock.patch.object('helpdesk.lib.FollowUpAttachment', 'save', autospec=True)
|
||||||
@override_settings(MEDIA_ROOT=MEDIA_DIR)
|
@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):
|
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 """
|
""" don't mock saving to filesystem to test file renames caused by storage layer """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user