aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Sabchuk <michel@turbosys.com.br>2014-09-01 10:25:11 -0300
committerMichel Sabchuk <michel@turbosys.com.br>2014-09-01 10:25:11 -0300
commit3e5f6553c8e51e8304004419e48fd169f84ca91e (patch)
tree7c95e8f007c29f6204fe4ff7d4e51bd9afc91226
parent624e04459d3282141385ff1a67f1c4673cd11f8f (diff)
downloaddjango-wkhtmltopdf-3e5f6553c8e51e8304004419e48fd169f84ca91e.tar.gz
django-wkhtmltopdf-3e5f6553c8e51e8304004419e48fd169f84ca91e.tar.bz2
django-wkhtmltopdf-3e5f6553c8e51e8304004419e48fd169f84ca91e.zip
Add failing test of unicode content.
-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.'