Skip to content

Commit

Permalink
TestCase for non-unicode form field label
Browse files Browse the repository at this point in the history
  • Loading branch information
akaariai committed May 27, 2013
1 parent bac187c commit 398d322
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/regressiontests/forms/tests/forms.py
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions 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.