~coalwater/loco-team-portal/fix-783544

« back to all changes in this revision

Viewing changes to loco_directory/meetings/tests.py

  • Committer: Tarmac
  • Author(s): Michael Hall
  • Date: 2011-06-28 13:00:33 UTC
  • mfrom: (440.1.1 meeting-unicode-error)
  • Revision ID: nigelbabu@gmail.com-20110628130033-f6k4lrjtbjcwousd
[r=chrisjohnston][mhall119][] Make sure that AgendaItem.__unicode__ returns a unicode string, rather than an ascii string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
"""
7
7
 
8
8
from django.test import TestCase
9
 
 
10
 
class SimpleTest(TestCase):
11
 
    def test_basic_addition(self):
12
 
        """
13
 
        Tests that 1 + 1 always equals 2.
14
 
        """
15
 
        self.failUnlessEqual(1 + 1, 2)
16
 
 
17
 
__test__ = {"doctest": """
18
 
Another way to test that 1 + 1 is equal to 2.
19
 
 
20
 
>>> 1 + 1 == 2
21
 
True
22
 
"""}
23
 
 
 
9
from meetings.models import AgendaItem
 
10
 
 
11
 
 
12
class UnicodeTest(TestCase):
 
13
 
 
14
    def setUp(self):
 
15
        super(UnicodeTest, self).setUp()
 
16
        self.test_string =  'test \xc3 string'
 
17
 
 
18
    def test_unicode_agenda_title(self):
 
19
        item = AgendaItem(title=self.test_string)
 
20
        self.assertEquals(unicode(item), self.test_string)
 
21
 
 
22
        child = AgendaItem(title=self.test_string, parent=item)
 
23
        self.assertEquals(unicode(child), u'%s->%s' % (self.test_string, self.test_string))