1 # -*- coding: utf-8 -*-
2 from __future__
import absolute_import
6 from django
.test
import TestCase
8 from .models
import Article
, InternationalArticle
11 class SimpleTests(TestCase
):
13 a
= Article
.objects
.create(
14 headline
='Area man programs in Python',
15 pub_date
=datetime
.datetime(2005, 7, 28)
17 self
.assertEqual(str(a
), 'Area man programs in Python')
18 self
.assertEqual(repr(a
), '<Article: Area man programs in Python>')
20 def test_international(self
):
21 a
= InternationalArticle
.objects
.create(
22 headline
=u
'Girl wins €12.500 in lottery',
23 pub_date
=datetime
.datetime(2005, 7, 28)
25 # The default str() output will be the UTF-8 encoded output of __unicode__().
26 self
.assertEqual(str(a
), 'Girl wins \xe2\x82\xac12.500 in lottery')