diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2006-06-06 01:21:49 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2006-06-06 01:21:49 +0000 |
| commit | e976ed1f7910fad03704f88853c5c5b36cbab134 (patch) | |
| tree | c4c8d32d4298f64ad9ce8e7813084c2f45a9dc40 /tests/modeltests/custom_methods | |
| parent | 0c341d780ebcde0e81c81eda07e2db3aaa92549b (diff) | |
multi-auth: Merged to [3085]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multi-auth@3086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/custom_methods')
| -rw-r--r-- | tests/modeltests/custom_methods/models.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/modeltests/custom_methods/models.py b/tests/modeltests/custom_methods/models.py index 6cc3fe8548..e314d97264 100644 --- a/tests/modeltests/custom_methods/models.py +++ b/tests/modeltests/custom_methods/models.py @@ -11,16 +11,16 @@ class Article(models.Model): headline = models.CharField(maxlength=100) pub_date = models.DateField() - def __repr__(self): + def __str__(self): return self.headline def was_published_today(self): return self.pub_date == datetime.date.today() - def get_articles_from_same_day_1(self): + def articles_from_same_day_1(self): return Article.objects.filter(pub_date=self.pub_date).exclude(id=self.id) - def get_articles_from_same_day_2(self): + def articles_from_same_day_2(self): """ Verbose version of get_articles_from_same_day_1, which does a custom database query for the sake of demonstration. @@ -47,12 +47,12 @@ API_TESTS = """ # Test the custom methods. >>> a.was_published_today() False ->>> a.get_articles_from_same_day_1() -[Beatles reunite] ->>> a.get_articles_from_same_day_2() -[Beatles reunite] ->>> b.get_articles_from_same_day_1() -[Area man programs in Python] ->>> b.get_articles_from_same_day_2() -[Area man programs in Python] +>>> a.articles_from_same_day_1() +[<Article: Beatles reunite>] +>>> a.articles_from_same_day_2() +[<Article: Beatles reunite>] +>>> b.articles_from_same_day_1() +[<Article: Area man programs in Python>] +>>> b.articles_from_same_day_2() +[<Article: Area man programs in Python>] """ |
