aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2012-01-16 10:14:54 +0000
committerMarc Tamlyn <marc.tamlyn@gmail.com>2012-01-16 10:14:54 +0000
commit6cf05d70a87cd33955670d43f14f28067f90379e (patch)
tree01fdb34a180503993a9ebd9dc9c1107a83bba606 /wkhtmltopdf
parent7710f08802aaf7fb8f7355bba00e5c3fd886209f (diff)
downloaddjango-wkhtmltopdf-6cf05d70a87cd33955670d43f14f28067f90379e.tar.gz
django-wkhtmltopdf-6cf05d70a87cd33955670d43f14f28067f90379e.tar.bz2
django-wkhtmltopdf-6cf05d70a87cd33955670d43f14f28067f90379e.zip
Test translation to temp file.
Diffstat (limited to 'wkhtmltopdf')
-rw-r--r--wkhtmltopdf/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/wkhtmltopdf/tests.py b/wkhtmltopdf/tests.py
index e69de29..5eb733f 100644
--- a/wkhtmltopdf/tests.py
+++ b/wkhtmltopdf/tests.py
@@ -0,0 +1,13 @@
+from django.test import TestCase
+
+from utils import template_to_temp_file
+
+class TestUtils(TestCase):
+ def test_template_to_temp_file(self):
+ """Should render a template to a temporary file."""
+ title = 'A test template.'
+ temp_file = template_to_temp_file('sample.html', {'title': title})
+ with open(temp_file, 'r') as f:
+ saved_content = f.read()
+ self.assertTrue(title in saved_content)
+