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 4
4
from django .contrib .contenttypes import generic
5
5
from django .contrib .contenttypes .models import ContentType
6
6
from 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
8
8
from django .utils .translation import ugettext_lazy as _
9
9
10
10
from . import settings
@@ -487,4 +487,4 @@ class Meta:
487
487
verbose_name_plural = _ ('tagged items' )
488
488
489
489
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 6
6
from django import forms
7
7
from django .db .models import Q
8
8
from django .test import TestCase
9
+ from django .utils import six
9
10
10
11
from tagging import settings
11
12
from tagging .forms import TagField
@@ -333,7 +334,7 @@ def test_unicode_tagged_object(self):
333
334
Tag .objects .update_tags (self .dead_parrot , u'föo' )
334
335
items = TaggedItem .objects .all ()
335
336
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]" )
337
338
338
339
def test_update_tags_with_none (self ):
339
340
# start off in a known, mildly interesting state
You can’t perform that action at this time.
0 commit comments