diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2012-08-08 07:50:59 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2012-08-08 07:50:59 -0700 |
| commit | 0955d16a165e9da2f69813cc9983fd10dddbfa62 (patch) | |
| tree | 14129dbfe6d584d4b8911662723c0caae751f860 /tests/regressiontests/multiple_database/tests.py | |
| parent | 7515f6576b593c5f7a1ff2b2f934d5442b52b884 (diff) | |
Switched to using the standard method for comparing querysets in teh templates.
Diffstat (limited to 'tests/regressiontests/multiple_database/tests.py')
| -rw-r--r-- | tests/regressiontests/multiple_database/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py index 08632fd4ce..74a5f2f550 100644 --- a/tests/regressiontests/multiple_database/tests.py +++ b/tests/regressiontests/multiple_database/tests.py @@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals import datetime import pickle +from operator import attrgetter from django.conf import settings from django.contrib.auth.models import User @@ -873,10 +874,10 @@ class QueryTestCase(TestCase): 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]) + self.assertQuerysetEqual(val, [dive.pk], attrgetter("pk")) val = Book.objects.raw('SELECT id FROM multiple_database_book').using('other') - self.assertEqual(map(lambda o: o.pk, val), [dive.pk]) + self.assertQuerysetEqual(val, [dive.pk], attrgetter("pk")) def test_select_related(self): "Database assignment is retained if an object is retrieved with select_related()" |
