code: def test_validate_non_json_content(self):
      response = self.get_response(content=b"foobar", status_code=400)
      try:
          utils.validate_response(response)
      except PlotlyRequestError as e:
          self.assertEqual(e.message, "foobar")
          self.assertEqual(e.status_code, 400)
          self.assertEqual(e.content, b"foobar")
      else:
          self.fail("Expected this to raise!")
  
imports: from __future__ import absolute_import
  import json
  from requests.exceptions import ConnectionError
  from plotly import version
  from chart_studio.api.utils import to_native_utf8_string
  from chart_studio.api.v2 import utils
  from chart_studio.exceptions import PlotlyRequestError
  from chart_studio.session import sign_in
  from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase
label_desc: Use image node_id 4 for calling the ValidateResponseTest obj's underlying member method code with example usage: obj.test_validate_non_json_content() without return types