1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[soc2009/multidb] Correct the handling of raw and defered fields with multi-db.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2009-12-21 02:38:38 +00:00
parent 8da7538b18
commit 4424a8d3d8
5 changed files with 16 additions and 4 deletions

View File

@@ -619,6 +619,13 @@ class QueryTestCase(TestCase):
self.assertEquals(learn.get_next_by_published().title, "Dive into Python")
self.assertEquals(dive.get_previous_by_published().title, "Learning Python")
def test_raw(self):
"test the raw() method across databases"
dive = Book.objects.using('other').create(title="Dive into Python",
published=datetime.date(2009, 5, 4))
val = Book.objects.db_manager("other").raw('SELECT id FROM "multiple_database_book"')
self.assertEqual(map(lambda o: o.pk, val), [dive.pk])
class UserProfileTestCase(TestCase):