MCPcopy
hub / github.com/django/django / test_no_request

Method test_no_request

tests/view_tests/tests/test_debug.py:1314–1330  ·  view source on GitHub ↗

An exception report can be generated without request

(self)

Source from the content-addressed store, hash-verified

1312 self.assertNotIn("Request data not supplied", text)
1313
1314 def test_no_request(self):
1315 "An exception report can be generated without request"
1316 try:
1317 raise ValueError("Can't find my keys")
1318 except ValueError:
1319 exc_type, exc_value, tb = sys.exc_info()
1320 reporter = ExceptionReporter(None, exc_type, exc_value, tb)
1321 text = reporter.get_traceback_text()
1322 self.assertIn("ValueError", text)
1323 self.assertIn("Can't find my keys", text)
1324 self.assertNotIn("Request Method:", text)
1325 self.assertNotIn("Request URL:", text)
1326 self.assertNotIn("USER:", text)
1327 self.assertIn("Exception Type:", text)
1328 self.assertIn("Exception Value:", text)
1329 self.assertIn("Traceback (most recent call last):", text)
1330 self.assertIn("Request data not supplied", text)
1331
1332 def test_no_exception(self):
1333 "An exception report can be generated for just a request"

Callers

nothing calls this directly

Calls 2

get_traceback_textMethod · 0.95
ExceptionReporterClass · 0.90

Tested by

no test coverage detected