From 8705fe0b1fafc607d06765e45c78fb3b69f9ae14 Mon Sep 17 00:00:00 2001 From: Martin Rey Date: Tue, 13 Oct 2020 03:27:23 +0200 Subject: [PATCH] [misc] Concat strings explicitly --- kibicara/platforms/email/bot.py | 4 ++-- tests/tests_email/test_api_email_happy_path.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kibicara/platforms/email/bot.py b/kibicara/platforms/email/bot.py index ec07f4f..4594451 100644 --- a/kibicara/platforms/email/bot.py +++ b/kibicara/platforms/email/bot.py @@ -44,8 +44,8 @@ class EmailBot(Censor): token = to_token(email=subscriber.email, hood=self.hood.id) body = ( '{0}\n\n--\n' - 'If you want to stop receiving these mails,' - 'follow this link: {1}/hoods/{2}/email-unsubscribe?token={3}' + + 'If you want to stop receiving these mails,' + + 'follow this link: {1}/hoods/{2}/email-unsubscribe?token={3}' ).format(message.text, config['frontend_url'], self.hood.id, token) try: logger.debug('Trying to send: \n{0}'.format(body)) diff --git a/tests/tests_email/test_api_email_happy_path.py b/tests/tests_email/test_api_email_happy_path.py index a3d3941..7a2557b 100644 --- a/tests/tests_email/test_api_email_happy_path.py +++ b/tests/tests_email/test_api_email_happy_path.py @@ -20,7 +20,7 @@ def test_email_subscribe_unsubscribe(client, hood_id, receive_email): body = mail['body'] confirm_url = findall( r'http[s]?://' - r'(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', + + r'(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', body, )[0] start = len('token=')