| 736 | assert a["Content-Disposition"] == "attachment; filename=foo" |
| 737 | |
| 738 | def test_reject_newlines(self): |
| 739 | h = self.storage_class() |
| 740 | |
| 741 | for variation in "foo\nbar", "foo\r\nbar", "foo\rbar": |
| 742 | with pytest.raises(ValueError): |
| 743 | h["foo"] = variation |
| 744 | with pytest.raises(ValueError): |
| 745 | h.add("foo", variation) |
| 746 | with pytest.raises(ValueError): |
| 747 | h.add("foo", "test", option=variation) |
| 748 | with pytest.raises(ValueError): |
| 749 | h.set("foo", variation) |
| 750 | with pytest.raises(ValueError): |
| 751 | h.set("foo", "test", option=variation) |
| 752 | |
| 753 | def test_slicing(self): |
| 754 | # there's nothing wrong with these being native strings |