示例#1
0
 def test_binary(self):
     """
     Binary data received. This also implicitly tests malformed
     JSON, and any content received along with a non-200 error.
     """
     responses.add(
         responses.POST,
         settings.XANALYTICS_URL,
         body="hello",
         content_type="application/octet-stream",
     )
     resp = _call(settings.XANALYTICS_URL, {})
     self.assertEqual(resp, {})
示例#2
0
 def test_server_down(self):
     """Endpoint unavailable."""
     resp = _call(settings.XANALYTICS_URL, {})
     self.assertEqual(resp, {})