File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 44from django .contrib .contenttypes import generic
55from django .contrib .contenttypes .models import ContentType
66from django .db import connection , models
7- from django .utils .encoding import python_2_unicode_compatible
7+ from django .utils .encoding import python_2_unicode_compatible , smart_text
88from django .utils .translation import ugettext_lazy as _
99
1010from . import settings
@@ -487,4 +487,4 @@ class Meta:
487487 verbose_name_plural = _ ('tagged items' )
488488
489489 def __str__ (self ):
490- return '%s [%s]' % (self .object , self .tag )
490+ return '%s [%s]' % (smart_text ( self .object ), smart_text ( self .tag ) )
Original file line number Diff line number Diff line change 66from django import forms
77from django .db .models import Q
88from django .test import TestCase
9+ from django .utils import six
910
1011from tagging import settings
1112from tagging .forms import TagField
@@ -333,7 +334,7 @@ def test_unicode_tagged_object(self):
333334 Tag .objects .update_tags (self .dead_parrot , u'föo' )
334335 items = TaggedItem .objects .all ()
335336 self .assertEqual (len (items ), 1 )
336- self .assertEqual (unicode (items [0 ]), u"dëad [föo]" )
337+ self .assertEqual (six . text_type (items [0 ]), u"dëad [föo]" )
337338
338339 def test_update_tags_with_none (self ):
339340 # start off in a known, mildly interesting state
You can’t perform that action at this time.
0 commit comments