aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wkhtmltopdf/tests/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/wkhtmltopdf/tests/tests.py b/wkhtmltopdf/tests/tests.py
index f296c8e..0c332f6 100644
--- a/wkhtmltopdf/tests/tests.py
+++ b/wkhtmltopdf/tests/tests.py
@@ -59,6 +59,17 @@ class TestUtils(TestCase):
finally:
temp_file.close()
+ def test_wkhtmltopdf_with_unicode_content(self):
+ """A wkhtmltopdf call should render unicode content properly"""
+ title = u'♥'
+ response = PDFTemplateResponse(self.factory.get('/'), None, context={'title': title})
+ temp_file = response.render_to_temporary_file('unicode.html')
+ try:
+ pdf_output = wkhtmltopdf(pages=[temp_file.name])
+ self.assertTrue(pdf_output.startswith(b'%PDF'), pdf_output)
+ finally:
+ temp_file.close()
+
def test_PDFTemplateResponse_render_to_temporary_file(self):
"""Should render a template to a temporary file."""
title = 'A test template.'