Commit 23cd6be0 authored by Sam Ruby's avatar Sam Ruby
parent 1e2b6a18
......@@ -40,7 +40,7 @@ def run(script, doc, output_file=None, options={}):
reluri = os.path.splitext(os.path.basename(output_file))[0]
context['url'] = urlparse.urljoin(config.link(),reluri)
f = open(output_file, 'w')
f.write(t.render(context))
f.write(t.render(context).encode('utf-8'))
f.close()
else:
# @@this is useful for testing purposes, but does it
......
......@@ -10,7 +10,7 @@
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
<entry>
<title>Atom-Powered Robots Run Amok</title>
<title>&#161;Atom-Powered Robots Run Amok!</title>
<link href="http://example.org/2003/12/13/atom03"/>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2003-12-13T18:30:02Z</updated>
......
......@@ -18,13 +18,13 @@ class DjangoFilterTests(unittest.TestCase):
results = dj.tmpl.template_info("<feed/>")
self.assertEqual(type(results['date']), datetime.datetime)
def test_django_item_title(self):
def test_django_entry_title(self):
config.load('tests/data/filter/django/test.ini')
feed = open('tests/data/filter/django/test.xml')
input = feed.read(); feed.close()
results = dj.run(
os.path.realpath('tests/data/filter/django/title.html.dj'), input)
self.assertEqual(results, "Atom-Powered Robots Run Amok\n")
self.assertEqual(results, "\xc2\xa1Atom-Powered Robots Run Amok!\n")
def test_django_config_context(self):
config.load('tests/data/filter/django/test.ini')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment