mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Migrated str doctests. Thanks to Eric Florenzano.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13827 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -30,23 +30,4 @@ class InternationalArticle(models.Model):
|
||||
pub_date = models.DateTimeField()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.headline
|
||||
|
||||
__test__ = {'API_TESTS':ur"""
|
||||
# Create an Article.
|
||||
>>> from datetime import datetime
|
||||
>>> a = Article(headline='Area man programs in Python', pub_date=datetime(2005, 7, 28))
|
||||
>>> a.save()
|
||||
|
||||
>>> str(a)
|
||||
'Area man programs in Python'
|
||||
|
||||
>>> a
|
||||
<Article: Area man programs in Python>
|
||||
|
||||
>>> a1 = InternationalArticle(headline=u'Girl wins €12.500 in lottery', pub_date=datetime(2005, 7, 28))
|
||||
|
||||
# The default str() output will be the UTF-8 encoded output of __unicode__().
|
||||
>>> str(a1)
|
||||
'Girl wins \xe2\x82\xac12.500 in lottery'
|
||||
"""}
|
||||
return self.headline
|
||||
Reference in New Issue
Block a user