From 592ac0d6764a19822fd9f513b2cc84664e1ecad6 Mon Sep 17 00:00:00 2001 From: Dmitry Gladkov Date: Tue, 2 Apr 2013 17:23:01 +0300 Subject: [PATCH 1/2] ticket #6 fixed unicode chars --- django_future_url/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_future_url/core.py b/django_future_url/core.py index 482552a..5d3a60e 100755 --- a/django_future_url/core.py +++ b/django_future_url/core.py @@ -88,11 +88,11 @@ def make_me_magic(write): if has_deprecated_tag(file_content): found = True log.info(file_path.replace(CURRENT_PATH + '/', '')) - new_content = parse_file(file_content) + new_content = parse_file(file_content.decode('utf-8')) if write: t_file.seek(0) - t_file.write(new_content) + t_file.write(new_content.encode('utf-8')) log.info(' File updated') if not found: From e4159cb04002c6273bb78fd5612792697a93a47b Mon Sep 17 00:00:00 2001 From: Victor Safronovich Date: Fri, 29 Mar 2013 13:55:07 +0600 Subject: [PATCH 2/2] restore core.py added templates that breaks the tests added test --- django_future_url/test/test_core.py | 6 ++++- .../test_project/templates/bad_chars.html | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 django_future_url/test/test_project/templates/bad_chars.html diff --git a/django_future_url/test/test_core.py b/django_future_url/test/test_core.py index afa3cf2..ce4f247 100644 --- a/django_future_url/test/test_core.py +++ b/django_future_url/test/test_core.py @@ -2,6 +2,7 @@ import os import subprocess import unittest +from django_future_url import core from django_future_url.core import parse_file @@ -32,4 +33,7 @@ def test_deprecated_urls_false_load(self): self.assertTemplateFixed('deprecated_urls_false_load') def test_should_not_be_upgraded(self): - self.assertTemplateFixed('should_not_be_upgraded') \ No newline at end of file + self.assertTemplateFixed('should_not_be_upgraded') + + def test_make_me_magic(self): + core.make_me_magic(write=False) \ No newline at end of file diff --git a/django_future_url/test/test_project/templates/bad_chars.html b/django_future_url/test/test_project/templates/bad_chars.html new file mode 100644 index 0000000..7d7dd5f --- /dev/null +++ b/django_future_url/test/test_project/templates/bad_chars.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block left_slot %} + +{% endblock %} + +{% block content %} +
+ {{competitor.title}} +
+ +
+ {{form.errors}} +
{% csrf_token %} + {{form.as_p}} + +
+
+ +{% endblock %}