From 0b7dd14d1f87e2ecef7aacc39fe4189667ed4fdf Mon Sep 17 00:00:00 2001 From: Boulder Sprinters Date: Fri, 9 Mar 2007 17:43:46 +0000 Subject: boulder-oracle-sprint: Merged to trunk [4692]. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4695 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/basic/models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/modeltests/basic') diff --git a/tests/modeltests/basic/models.py b/tests/modeltests/basic/models.py index 2ebe857e7e..062f8b29ed 100644 --- a/tests/modeltests/basic/models.py +++ b/tests/modeltests/basic/models.py @@ -14,7 +14,7 @@ class Article(models.Model): class Meta: ordering = ('pub_date','headline') - + def __str__(self): return self.headline @@ -321,7 +321,6 @@ AttributeError: Manager isn't accessible via Article instances >>> Article.objects.filter(id__lte=4).delete() >>> Article.objects.all() [, , , ] - """} from django.conf import settings @@ -360,4 +359,11 @@ __test__['API_TESTS'] += """ >>> a10 = Article.objects.create(headline="Article 10", pub_date=datetime(2005, 7, 31, 12, 30, 45)) >>> Article.objects.get(headline="Article 10") + +# Edge-case test: A year lookup should retrieve all objects in the given +year, including Jan. 1 and Dec. 31. +>>> a11 = Article.objects.create(headline='Article 11', pub_date=datetime(2008, 1, 1)) +>>> a12 = Article.objects.create(headline='Article 12', pub_date=datetime(2008, 12, 31, 23, 59, 59, 999999)) +>>> Article.objects.filter(pub_date__year=2008) +[, ] """ -- cgit v1.3