summaryrefslogtreecommitdiff
path: root/service/test/unit/resources
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-03-17 11:18:39 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-03-17 11:18:39 -0300
commit067db035910c8284d508401c34ca4cb5928c2b52 (patch)
treebe4e94c21c6b6cf29a5d26b1debecbbf36b87fc2 /service/test/unit/resources
parent3bc6901663c60e6b477477bd6e47e9f60fbb895b (diff)
[#1012] Generates recovery code in soledad client
with @tayanefernandes
Diffstat (limited to 'service/test/unit/resources')
-rw-r--r--service/test/unit/resources/test_backup_account_resource.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/service/test/unit/resources/test_backup_account_resource.py b/service/test/unit/resources/test_backup_account_resource.py
index 2e676d9b..09520969 100644
--- a/service/test/unit/resources/test_backup_account_resource.py
+++ b/service/test/unit/resources/test_backup_account_resource.py
@@ -16,7 +16,8 @@
import os
-from mock import MagicMock, patch
+from mock import MagicMock, patch, ANY
+
from twisted.trial import unittest
from twisted.web.test.requesthelper import DummyRequest
from twisted.internet import defer
@@ -48,12 +49,14 @@ class TestBackupAccountResource(unittest.TestCase):
mock_account_recovery = MagicMock()
mock_account_recovery_init.return_value = mock_account_recovery
mock_account_recovery.update_recovery_code.return_value = defer.succeed("Success")
+
request = DummyRequest(['/backup-account'])
request.method = 'POST'
d = self.web.get(request)
def assert_update_recovery_code_called(_):
- mock_account_recovery_init.assert_called_with(self.resource._authenticator.bonafide_session)
+ mock_account_recovery_init.assert_called_with(
+ self.resource._authenticator.bonafide_session, ANY)
mock_account_recovery.update_recovery_code.assert_called()
d.addCallback(assert_update_recovery_code_called)