fix invalid logging

the first argument to ANY logger.____ function is ALWAYS cast to a
string and used as a format argument for ALL remaining arguments
using %s formatting. even `logger.exception`, which just logs as
normal and then appends the stack trace.

so we shouldn't be passing `e` into logger.exception - just
`logger.exception('something went wrong!')`

also de-duplicated a test
This commit is contained in:
Leo Hemsted
2016-12-15 17:30:05 +00:00
parent a197754906
commit 0136e1e32d
3 changed files with 6 additions and 10 deletions

View File

@@ -98,7 +98,7 @@ def test_send_sms_raises_if_firetext_rejects(mocker, mock_firetext_client):
assert '"code": 1' in exc.value.text
def test_send_sms_raises_if_firetext_rejects(mocker, mock_firetext_client):
def test_send_sms_raises_if_firetext_rejects_with_unexpected_data(mocker, mock_firetext_client):
to = content = reference = 'foo'
response_dict = {"something": "gone bad"}