Tests: fix MockRequestsBackend.get_api_call_arg edge cases

get_api_call_arg had incorrectly returned None if a kwarg was passed
to the mocked function with a False-y value (e.g., [] or {})

get_api_call_json had only considered data param, ignoring json param
requests added a while back
This commit is contained in:
medmunds
2018-01-17 13:53:06 -08:00
parent 2bf492c2f4
commit 5fb46952c6
3 changed files with 38 additions and 27 deletions

View File

@@ -108,7 +108,7 @@ class MailgunBackendStandardEmailTests(MailgunBackendMockAPITestCase):
self.assertEqual(data['html'], html_content)
# Don't accidentally send the html part as an attachment:
files = self.get_api_call_files(required=False)
self.assertIsNone(files)
self.assertFalse(files)
def test_html_only_message(self):
html_content = '<p>This is an <strong>important</strong> message.</p>'