From 23cd6be041689f3e015b29723c8415263060ec7d Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Thu, 5 Jul 2007 15:01:19 -0400 Subject: [PATCH] http://amit.chakradeo.net/2007/07/05/django-unicode-integration-fix-for-venus-djando-template/ --- planet/shell/dj.py | 2 +- tests/data/filter/django/test.xml | 2 +- tests/test_filter_django.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/planet/shell/dj.py b/planet/shell/dj.py index 2ce316a..c2cb2e2 100644 --- a/planet/shell/dj.py +++ b/planet/shell/dj.py @@ -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 diff --git a/tests/data/filter/django/test.xml b/tests/data/filter/django/test.xml index 18ab87a..323a3e8 100644 --- a/tests/data/filter/django/test.xml +++ b/tests/data/filter/django/test.xml @@ -10,7 +10,7 @@ urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6 - Atom-Powered Robots Run Amok + ¡Atom-Powered Robots Run Amok! urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z diff --git a/tests/test_filter_django.py b/tests/test_filter_django.py index a7ca46a..67774b8 100644 --- a/tests/test_filter_django.py +++ b/tests/test_filter_django.py @@ -18,13 +18,13 @@ class DjangoFilterTests(unittest.TestCase): results = dj.tmpl.template_info("") 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')