diff --git a/octodns/manager.py b/octodns/manager.py index dcbf083..104e445 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -261,7 +261,8 @@ class Manager(object): try: source.populate(zone, lenient=lenient) except TypeError as e: - if "keyword argument 'lenient'" not in text_type(e): + if ("unexpected keyword argument 'lenient'" + not in text_type(e)): raise self.log.warn('provider %s does not accept lenient ' 'param', source.__class__.__name__) diff --git a/tests/test_octodns_provider_ultra.py b/tests/test_octodns_provider_ultra.py index 52e0307..a22a489 100644 --- a/tests/test_octodns_provider_ultra.py +++ b/tests/test_octodns_provider_ultra.py @@ -1,8 +1,11 @@ +from __future__ import unicode_literals + from mock import Mock, call from os.path import dirname, join from requests import HTTPError from requests_mock import ANY, mock as requests_mock from six import text_type +from six.moves.urllib import parse from unittest import TestCase from json import load as json_load @@ -55,7 +58,8 @@ class TestUltraProvider(TestCase): self.assertEquals(1, mock.call_count) expected_payload = "grant_type=password&username=user&"\ "password=rightpass" - self.assertEquals(mock.last_request.text, expected_payload) + self.assertEquals(parse.parse_qs(mock.last_request.text), + parse.parse_qs(expected_payload)) def test_get_zones(self): provider = _get_provider() diff --git a/tests/test_octodns_source_envvar.py b/tests/test_octodns_source_envvar.py index 0714883..ac66a22 100644 --- a/tests/test_octodns_source_envvar.py +++ b/tests/test_octodns_source_envvar.py @@ -1,6 +1,6 @@ +from mock import patch from six import text_type from unittest import TestCase -from unittest.mock import patch from octodns.source.envvar import EnvVarSource from octodns.source.envvar import EnvironmentVariableNotFoundException