Cookie will expire if max_age is provided.
(self)
| 61 | ) |
| 62 | |
| 63 | def test_max_age_expiration(self): |
| 64 | """Cookie will expire if max_age is provided.""" |
| 65 | response = HttpResponse() |
| 66 | set_cookie_time = time.time() |
| 67 | with freeze_time(set_cookie_time): |
| 68 | response.set_cookie("max_age", max_age=10) |
| 69 | max_age_cookie = response.cookies["max_age"] |
| 70 | self.assertEqual(max_age_cookie["max-age"], 10) |
| 71 | self.assertEqual(max_age_cookie["expires"], http_date(set_cookie_time + 10)) |
| 72 | |
| 73 | def test_max_age_int(self): |
| 74 | response = HttpResponse() |
nothing calls this directly
no test coverage detected