tests: update check against json exception message (#36515)
This commit is contained in:
parent
7dcd2d485b
commit
625b574280
|
@ -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) == []
|
||||
|
|
Loading…
Reference in New Issue