# side effect to immediately create a copy of the object to preserve original properties (since, apparently, the magic mock passes the json object by reference)
mock_response.json.return_value={'message':"xAPI statements successfully stored in LRS"}
mock_response.__bool__.return_value=True# important since we check "if not res" in xapi.views
# side effect to immediately create a copy of the object to preserve original properties (since, apparently, the magic mock passes the json object by reference)
print("Could not forward to ",additional_lrs["url"],":",res.reasonifresisnotNoneelse"URL could not be reached","({})".format(res.status_code)ifresisnotNoneelse"")
elifresandsettings.DEBUG:
print("Forwarded statement to ",additional_lrs["url"],":",res.reason,"({})".format(res.status_code))