summaryrefslogtreecommitdiff
path: root/service/test/unit
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-04-19 13:51:47 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-04-19 14:11:44 -0300
commita3763301042c5db0231b0e9e2d4a62d41d374d49 (patch)
treed2a6f93237e08d79f1091e0ed51c6a2b4f51ab1a /service/test/unit
parent995446a82ef694e0705e94effb494812e0b3ae9f (diff)
[#927] Adds date to recovery code email
with @deniscostadsc
Diffstat (limited to 'service/test/unit')
-rw-r--r--service/test/unit/test_account_recovery.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/service/test/unit/test_account_recovery.py b/service/test/unit/test_account_recovery.py
index e595fc5a..cb5ed520 100644
--- a/service/test/unit/test_account_recovery.py
+++ b/service/test/unit/test_account_recovery.py
@@ -85,11 +85,13 @@ class AccountRecoveryTest(unittest.TestCase):
mock_resource.assert_called_once_with('pixelated.assets',
'recovery.mail.pt-BR')
+ @patch('pixelated.account_recovery.formatdate')
@patch('pixelated.account_recovery.smtp.sendmail')
@patch('pixelated.account_recovery.pkg_resources.resource_filename')
@defer.inlineCallbacks
- def test_send_recovery_code_by_email(self, mock_resource, mock_sendmail):
+ def test_send_recovery_code_by_email(self, mock_resource, mock_sendmail, mock_formatdate):
mock_sendmail.return_value = defer.succeed(None)
+ mock_formatdate.return_value = 'Sat, 21 Mar 2015 19:30:09 -0300'
sender = 'team@{}'.format(self.domain)
mock_file_content = '{backup_email}, {sender}, {date}, {domain}, {recovery_code}, {account_recovery_url}'