1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[soc2009/multidb] Updated DateQuery to work correctly with multiple databases

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@10943 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2009-06-07 23:56:42 +00:00
parent f57bc92842
commit 1653ffb571
5 changed files with 17 additions and 12 deletions

View File

@@ -56,3 +56,9 @@ class QueryTestCase(TestCase):
pro = Book.objects.using(db).get(published__year=2008)
self.assertEqual(pro.title, "Pro Django")
self.assertEqual(pro.published, datetime.date(2008, 12, 16))
years = Book.objects.using(db).dates('published', 'year')
self.assertEqual([o.year for o in years], [2008, 2009])
months = Book.objects.dates('published', 'month').using(db)
self.assertEqual(sorted(o.month for o in months), [5, 12])