mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[soc2009/multidb] Fixed the usage of the connection during Query construction, and defer it until actual SQL construction. In practice this means the GROUP BY optimization we do will be correctly applied based on the connection the Query is executed against, as oppossed to the on the QuerySet is targeting at the time the GROUP BY items are added
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@10934 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -49,3 +49,10 @@ class QueryTestCase(TestCase):
|
||||
|
||||
dive = Book.objects.using(db).get(title__icontains="dive")
|
||||
self.assertEqual(dive.title, "Dive into Python")
|
||||
|
||||
dive = Book.objects.using(db).get(title__iexact="dive INTO python")
|
||||
self.assertEqual(dive.title, "Dive into Python")
|
||||
|
||||
pro = Book.objects.using(db).get(published__year=2008)
|
||||
self.assertEqual(pro.title, "Pro Django")
|
||||
self.assertEqual(pro.published, datetime.date(2008, 12, 16))
|
||||
|
||||
Reference in New Issue
Block a user