diff --git a/tests/test_datasource.py b/tests/test_datasource.py index 57cbbbc89..438d57ec5 100644 --- a/tests/test_datasource.py +++ b/tests/test_datasource.py @@ -7,6 +7,7 @@ import json import sys import shutil +from django.utils import six from django.utils.six import StringIO from django.utils.six.moves.urllib import parse as urlparse @@ -282,7 +283,10 @@ def test_json_datasource_bad_url(http_requests, caplog): datasource = {'type': 'json', 'value': 'http://remote.example.net/xml'} assert data_sources.get_items(datasource) == [] assert 'Error reading JSON data source output' in caplog.records[-1].message - assert 'No JSON object could be decoded' in caplog.records[-1].message + if six.PY2: + assert 'No JSON object could be decoded' in caplog.records[-1].message + else: + assert 'Expecting value:' in caplog.records[-1].message datasource = {'type': 'json', 'value': 'http://remote.example.net/connection-error'} assert data_sources.get_items(datasource) == []