summaryrefslogtreecommitdiff
path: root/service/test/unit
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2017-04-10 17:51:30 -0300
committerTulio Casagrande <tcasagra@thoughtworks.com>2017-04-10 17:52:07 -0300
commit3395e1ca4cd6fe2d3d4770257242e0dc470dc11f (patch)
tree6fa917cd6891e81a9116d029ff15a26ddcee6553 /service/test/unit
parent264da7ad65744ebdf7f1f467b0a86e6565d7d7a5 (diff)
[#927] Refactor tests
with @deniscostadsc
Diffstat (limited to 'service/test/unit')
-rw-r--r--service/test/unit/test_account_recovery.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/service/test/unit/test_account_recovery.py b/service/test/unit/test_account_recovery.py
index cd6835a9..96dbc402 100644
--- a/service/test/unit/test_account_recovery.py
+++ b/service/test/unit/test_account_recovery.py
@@ -47,7 +47,7 @@ class AccountRecoveryTest(unittest.TestCase):
@defer.inlineCallbacks
def test_update_recovery_code(self):
when(self.account_recovery)._send_mail(ANY).thenReturn(defer.succeed(None))
- response = yield self.account_recovery.update_recovery_code()
+ yield self.account_recovery.update_recovery_code()
self.mock_bonafide_session.update_recovery_code.assert_called_once_with(self.generated_code)
@defer.inlineCallbacks
@@ -58,10 +58,8 @@ class AccountRecoveryTest(unittest.TestCase):
msg['From'] = sender
msg['To'] = self.backup_email
- result = MagicMock()
- deferred_sendmail = defer.succeed(result)
- with patch.object(smtp, 'sendmail', return_value=deferred_sendmail) as mock_sendmail:
- response = yield self.account_recovery._send_mail(self.generated_code, self.backup_email)
+ with patch.object(smtp, 'sendmail', return_value=defer.succeed(None)) as mock_sendmail:
+ yield self.account_recovery._send_mail(self.generated_code, self.backup_email)
mock_sendmail.assert_called_with(
self.mock_smtp_config.remote_smtp_host,