| 275 | assert replay_call.called |
| 276 | |
| 277 | def test_flow_content(self): |
| 278 | f = self.view.get_by_id("42") |
| 279 | f.backup() |
| 280 | f.response.headers["Content-Disposition"] = 'inline; filename="filename.jpg"' |
| 281 | |
| 282 | r = self.fetch("/flows/42/response/content.data") |
| 283 | assert r.body == b"message" |
| 284 | assert r.headers["Content-Disposition"] == 'attachment; filename="filename.jpg"' |
| 285 | |
| 286 | del f.response.headers["Content-Disposition"] |
| 287 | f.request.path = "/foo/bar.jpg" |
| 288 | assert ( |
| 289 | self.fetch("/flows/42/response/content.data").headers["Content-Disposition"] |
| 290 | == "attachment; filename=bar.jpg" |
| 291 | ) |
| 292 | |
| 293 | f.response.content = b"" |
| 294 | r = self.fetch("/flows/42/response/content.data") |
| 295 | assert r.code == 200 |
| 296 | assert r.body == b"" |
| 297 | |
| 298 | f.revert() |
| 299 | |
| 300 | def test_flow_content_returns_raw_content_when_decoding_fails(self): |
| 301 | f = self.view.get_by_id("42") |