Permalink
Browse files

TestCase for non-unicode form field label

  • Loading branch information...
1 parent bac187c commit 398d32277f08b20327c5f9955644dfeffe8cae0e @akaariai committed May 27, 2013
View
7 tests/regressiontests/forms/tests/forms.py
@@ -13,6 +13,13 @@
from django.utils.safestring import mark_safe
from django.utils import six
+from .non_unicode_forms import TestForm
+
+class TestNonUnicodeLabel(TestCase):
+ def test_non_unicode_label(self):
+ tf = TestForm()
+ self.assertTrue(isinstance(tf.fields['a_field'].label, six.text_type))
+
class Person(Form):
first_name = CharField()
View
6 tests/regressiontests/forms/tests/non_unicode_forms.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# Note: Intentionally no from __future__ import unicode_literals
+from django import forms
+
+class TestForm(forms.Form):
+ a_field = forms.IntegerField(label='fää')

0 comments on commit 398d322

Please sign in to comment.