Skip to content

Commit

Permalink
fix test for py2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTango committed Jul 2, 2019
1 parent 9855740 commit 0aeaa53
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plone/app/blocks/tests/test_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
import unittest


try:
# Python 2: "unicode" is built-in
unicode
except NameError:
unicode = str


class ITestTile(Interface):

magicNumber = schema.Int(title=u"Magic number", required=False)
Expand Down Expand Up @@ -222,11 +229,11 @@ def testRenderTiles(self):
request = self.layer['request']
tree = serializer.tree
renderTiles(request, tree)
result = str(serializer)
result = unicode(serializer)
self.assertIn('This is a demo tile with id tile2', result)
self.assertIn('This is a demo tile with id tile3', result)
self.assertIn('This is a demo tile with id tile4', result)
self.assertIn(u'Umlauts: Übertile', result)
self.assertIn(u'Umlauts: \xdcbertile', result)

def testRenderTilesError(self):
serializer = getHTMLSerializer([testLayout2])
Expand Down

0 comments on commit 0aeaa53

Please sign in to comment.