Commits

Anonymous committed 28cae89

force_text in assertRaisesMessage

  • Participants
  • Parent commits 79a2b02
  • Branches field-validation-error

Comments (0)

Files changed (1)

jsonfield/tests/base.py

 #:coding=utf-8:
 from django.test import TestCase as DjangoTestCase
 from django.utils import unittest
+from django.utils.encoding import force_text
 from django import forms
 
 from jsonfield.tests.jsonfield_test_app.models import *
     def test_formfield_clean_blank(self):
         field = JSONField("test")
         formfield = field.formfield()
-        self.assertRaisesMessage(forms.ValidationError, formfield.error_messages['required'], formfield.clean, value='')
+        self.assertRaisesMessage(forms.ValidationError, force_text(formfield.error_messages['required']), formfield.clean, value='')
 
     def test_formfield_clean_none(self):
         field = JSONField("test")
         formfield = field.formfield()
-        self.assertRaisesMessage(forms.ValidationError, formfield.error_messages['required'], formfield.clean, value=None)
+        self.assertRaisesMessage(forms.ValidationError, force_text(formfield.error_messages['required']), formfield.clean, value=None)
 
     def test_formfield_null_and_blank_clean_blank(self):
         field = JSONField("test", null=True, blank=True)