| 12 | |
| 13 | |
| 14 | class TestPermanentRedirects: |
| 15 | def setup_method(self): |
| 16 | self.sess = CacheControl(requests.Session()) |
| 17 | |
| 18 | def test_redirect_response_is_cached(self, url): |
| 19 | self.sess.get(url + "permanent_redirect", allow_redirects=False) |
| 20 | |
| 21 | resp = self.sess.get(url + "permanent_redirect", allow_redirects=False) |
| 22 | assert resp.from_cache |
| 23 | |
| 24 | def test_bust_cache_on_redirect(self, url): |
| 25 | self.sess.get(url + "permanent_redirect", allow_redirects=False) |
| 26 | |
| 27 | resp = self.sess.get( |
| 28 | url + "permanent_redirect", |
| 29 | headers={"cache-control": "no-cache"}, |
| 30 | allow_redirects=False, |
| 31 | ) |
| 32 | assert not resp.from_cache |
| 33 | |
| 34 | |
| 35 | class TestMultipleChoicesRedirects: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…