Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switched to using the standard method for comparing querysets in teh …

…templates.
  • Loading branch information...
commit 0955d16a165e9da2f69813cc9983fd10dddbfa62 1 parent 7515f65
@alex alex authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/regressiontests/multiple_database/tests.py
View
5 tests/regressiontests/multiple_database/tests.py
@@ -2,6 +2,7 @@
import datetime
import pickle
+from operator import attrgetter
from django.conf import settings
from django.contrib.auth.models import User
@@ -873,10 +874,10 @@ def test_raw(self):
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()"
Please sign in to comment.
Something went wrong with that request. Please try again.