diff options
Diffstat (limited to 'service/test/unit/resources')
-rw-r--r-- | service/test/unit/resources/test_backup_account_resource.py | 7 |
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) |