An exception report can be generated without request
(self)
| 600 | self.assertIn("<p>No POST data</p>", html) |
| 601 | |
| 602 | def test_no_request(self): |
| 603 | "An exception report can be generated without request" |
| 604 | try: |
| 605 | raise ValueError("Can't find my keys") |
| 606 | except ValueError: |
| 607 | exc_type, exc_value, tb = sys.exc_info() |
| 608 | reporter = ExceptionReporter(None, exc_type, exc_value, tb) |
| 609 | html = reporter.get_traceback_html() |
| 610 | self.assertInHTML("<h1>ValueError</h1>", html) |
| 611 | self.assertIn( |
| 612 | '<pre class="exception_value">Can't find my keys</pre>', html |
| 613 | ) |
| 614 | self.assertNotIn('<th scope="row">Request Method:</th>', html) |
| 615 | self.assertNotIn('<th scope="row">Request URL:</th>', html) |
| 616 | self.assertNotIn('<h3 id="user-info">USER</h3>', html) |
| 617 | self.assertIn('<th scope="row">Exception Type:</th>', html) |
| 618 | self.assertIn('<th scope="row">Exception Value:</th>', html) |
| 619 | self.assertIn("<h2>Traceback ", html) |
| 620 | self.assertIn("<h2>Request information</h2>", html) |
| 621 | self.assertIn("<p>Request data not supplied</p>", html) |
| 622 | |
| 623 | def test_sharing_traceback(self): |
| 624 | try: |
nothing calls this directly
no test coverage detected