Fixed repr in widget

This commit is contained in:
Oskar Hahn 2013-09-07 15:19:03 +02:00
parent 611c743364
commit afe186add4
2 changed files with 5 additions and 1 deletions

View File

@ -146,7 +146,7 @@ class Widget(object):
return self.display_name return self.display_name
def __repr__(self): def __repr__(self):
return unicode(self.display_name) return repr(self.display_name)
def __unicode__(self): def __unicode__(self):
return unicode(self.display_name) return unicode(self.display_name)

View File

@ -21,3 +21,7 @@ class WidgetObject(TestCase):
def test_error(self): def test_error(self):
with self.assertRaises(OpenSlidesError): with self.assertRaises(OpenSlidesError):
w = Widget(HttpRequest(), name='chahghuyeim8ie0Noong') w = Widget(HttpRequest(), name='chahghuyeim8ie0Noong')
def test_repr(self):
w = Widget(HttpRequest(), name='abcdefgäöüß', html='<strong>html</strong>')
self.assertEqual(repr(w), repr('Abcdefgäöüß'))