An exception report can be generated without request
(self)
| 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" |
nothing calls this directly
no test coverage detected