email_mirror: Insert a new line before attachment links.

This commit is contained in:
Mateusz Mandera
2020-01-14 13:05:14 +01:00
committed by Tim Abbott
parent 8226573af6
commit 1561d144e0
2 changed files with 3 additions and 1 deletions

View File

@@ -141,6 +141,8 @@ def construct_zulip_body(message: message.Message, realm: Realm, show_sender: bo
if not include_footer:
body = filter_footer(body)
if not body.endswith('\n'):
body += '\n'
body += extract_and_upload_attachments(message, realm)
body = body.strip()
if not body:

View File

@@ -422,7 +422,7 @@ class TestEmailMirrorMessagesWithAttachments(ZulipTestCase):
target_realm=user_profile.realm)
message = most_recent_message(user_profile)
self.assertEqual(message.content, "Test body[image.png](https://test_url)")
self.assertEqual(message.content, "Test body\n[image.png](https://test_url)")
def test_message_with_invalid_attachment(self) -> None:
user_profile = self.example_user('hamlet')