summaryrefslogtreecommitdiff
path: root/service/test/unit/user_agent_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/unit/user_agent_test.py')
-rw-r--r--service/test/unit/user_agent_test.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/service/test/unit/user_agent_test.py b/service/test/unit/user_agent_test.py
index 0ea83a5d..49a70dd6 100644
--- a/service/test/unit/user_agent_test.py
+++ b/service/test/unit/user_agent_test.py
@@ -46,34 +46,6 @@ class UserAgentTest(unittest.TestCase):
def tearDown(self):
unstub()
- def test_sending_mail_return_sent_mail_data_when_send_succeeds(self):
- self.input_mail = test_helper.input_mail()
- when(self.mail_service).send(1, self.input_mail).thenReturn(self.input_mail)
- self.input_mail.as_dict = lambda: {'header': {'from': 'a@a.a', 'to': 'b@b.b'},
- 'ident': 1,
- 'tags': [],
- 'status': [],
- 'security_casing': {},
- 'body': 'email body'}
-
- result = self.app.post('/mails', data='{"ident":1}', content_type="application/json")
-
- self.assertEqual(result.status_code, 200)
- self.assertEqual(result.data, '{"status": [], "body": "email body", "ident": 1, "tags": [], "header": {"to": "b@b.b", "from": "a@a.a"}, "security_casing": {}}')
-
- def test_sending_mail_return_error_message_when_send_fails(self):
- self.input_mail = test_helper.input_mail()
-
- def send_that_throws_exception(id, mail):
- raise Exception('email sending failed', 'more information of error')
-
- self.mail_service.send = send_that_throws_exception
-
- result = self.app.post('/mails', data='{"ident":1}', content_type="application/json")
-
- self.assertEqual(result.status_code, 500)
- self.assertEqual(result.data, '{"message": "email sending failed\\nmore information of error"}')
-
def test_that_default_config_file_is_home_dot_pixelated(self):
orig_config = pixelated.user_agent.app.config
try: