diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-31 17:32:49 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-31 17:32:49 -0300 |
commit | 304215fe36666c8401bd9fa01a50cab61ddc10ca (patch) | |
tree | 58d15414134ef5554e947348179e92e248df433b /service/test/unit | |
parent | da79ad444e3021c785c9b5d9c6cf8df8836d8563 (diff) |
[#927] Log exception with recovery code
with @tayanefernandes
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/resources/test_backup_account_resource.py | 8 | ||||
-rw-r--r-- | service/test/unit/resources/test_base_resource.py | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/service/test/unit/resources/test_backup_account_resource.py b/service/test/unit/resources/test_backup_account_resource.py index b8654203..e5e2793a 100644 --- a/service/test/unit/resources/test_backup_account_resource.py +++ b/service/test/unit/resources/test_backup_account_resource.py @@ -59,7 +59,7 @@ class TestBackupAccountResource(unittest.TestCase): self.resource._authenticator.bonafide_session, self.resource.soledad(request), self.resource._service(request, '_leap_session').smtp_config, - self.resource.get_backup_email(request)) + self.resource._get_backup_email(request)) mock_account_recovery.update_recovery_code.assert_called() d.addCallback(assert_update_recovery_code_called) @@ -94,3 +94,9 @@ class TestBackupAccountResource(unittest.TestCase): d.addCallback(assert_successful_response) return d + + def test_get_backup_email_from_request(self): + request = MagicMock() + request.content.getvalue.return_value = '{"backupEmail": "test@test.com"}' + + self.assertEqual(self.resource._get_backup_email(request), 'test@test.com') diff --git a/service/test/unit/resources/test_base_resource.py b/service/test/unit/resources/test_base_resource.py index d7110917..35ae67c7 100644 --- a/service/test/unit/resources/test_base_resource.py +++ b/service/test/unit/resources/test_base_resource.py @@ -25,11 +25,3 @@ class TestBaseResource(unittest.TestCase): base_resource = BaseResource(mock_services_factory) self.assertEqual(base_resource.soledad('request'), mock_services_factory.services()._leap_session.soledad) - - def test_get_backup_email_from_request(self): - mock_services_factory = MagicMock() - request = MagicMock() - request.content.getvalue.return_value = '{"backupEmail": "test@test.com"}' - base_resource = BaseResource(mock_services_factory) - - self.assertEqual(base_resource.get_backup_email(request), 'test@test.com') |