
    def test_real_pdf_bytes(self):
        pdf = html_to_pdf("<html><body><h1>Invoice</h1><p>Amount: $1,240.00</p></body></html>")
        assert pdf[:4] == b"%PDF"
>       assert b"/Pages" in pdf or b"Pages" in pdf
E       AssertionError: assert (b'/Pages' in b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n5 0 obj\n<</Filter /FlateDecode/Length 177>>\nstream\nx\xdaU\x8d\xcb\n\xc2@\x0cE\xf7\xf...xad\xa3\x99\xcc\xac\xfdim1\xab\xd9LR\xfe\xea\xe3\xb8\xe1\x07\x84\xf6\x06b\nendstream\nendobj\nstartxref\n4906\n%%EOF\n' or b'Pages' in b'%PDF-1.7\n%\xf0\x9f\x96\xa4\n5 0 obj\n<</Filter /FlateDecode/Length 177>>\nstream\nx\xdaU\x8d\xcb\n\xc2@\x0cE\xf7\xf...xad\xa3\x99\xcc\xac\xfdim1\xab\xd9LR\xfe\xea\xe3\xb8\xe1\x07\x84\xf6\x06b\nendstream\nendobj\nstartxref\n4906\n%%EOF\n')

tests/test_message_builder.py:105: AssertionError
--

    def test_script_stripped(self):
        out = sanitize_preview('<p>ok</p><script>alert(1)</script>')
        assert "<script" not in out
>       assert "alert" not in out
E       AssertionError: assert 'alert' not in '<p>ok</p>&l...;/script&gt;'
--
E           <p>ok</p>&lt;script&gt;alert(1)&lt;/script&gt;
E         ?                        +++++

tests/test_message_builder.py:120: AssertionError
