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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user