diff --git a/sparkpost/transmissions.py b/sparkpost/transmissions.py index da79cc9..667b891 100644 --- a/sparkpost/transmissions.py +++ b/sparkpost/transmissions.py @@ -139,7 +139,7 @@ def _parse_address(self, address): def _extract_recipients(self, recipients): - if not (isinstance(recipients, list) or isinstance(recipients, dict)): + if not (isinstance(recipients, (list, dict))): raise SparkPostException('recipients must be a list or dict') formatted_recipients = [] diff --git a/test/test_transmissions.py b/test/test_transmissions.py index f9ec23a..a5d6ae0 100644 --- a/test/test_transmissions.py +++ b/test/test_transmissions.py @@ -28,13 +28,6 @@ def test_translate_keys_with_recips(): {'key': 'value'}, {'address': {'email': 'foobar'}}] - results = t._translate_keys( - recipients=[{'address': {'name': 'foo', 'email': 'bar'}}] - ) - assert results['recipients'] == [ - {'address': {'name': 'foo', 'email': 'bar'}} - ] - def test_exceptions_for_recipients(): t = Transmissions('uri', 'key')