From 6cf05d70a87cd33955670d43f14f28067f90379e Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Mon, 16 Jan 2012 10:14:54 +0000 Subject: Test translation to temp file. --- wkhtmltopdf/tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'wkhtmltopdf') 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) + -- cgit v1.2.3