(self)
| 599 | |
| 600 | class HttpResponseSubclassesTests(SimpleTestCase): |
| 601 | def test_redirect(self): |
| 602 | response = HttpResponseRedirect("/redirected/") |
| 603 | self.assertEqual(response.status_code, 302) |
| 604 | # Standard HttpResponse init args can be used |
| 605 | response = HttpResponseRedirect( |
| 606 | "/redirected/", |
| 607 | content="The resource has temporarily moved", |
| 608 | ) |
| 609 | self.assertContains( |
| 610 | response, "The resource has temporarily moved", status_code=302 |
| 611 | ) |
| 612 | self.assertEqual(response.url, response.headers["Location"]) |
| 613 | |
| 614 | def test_redirect_lazy(self): |
| 615 | """Make sure HttpResponseRedirect works with lazy strings.""" |
nothing calls this directly
no test coverage detected