Permalink
Browse files

[soc2010/query-refactor] Fixed querying for objects by their related …

…objects (by their primary keys).

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13431 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent d83203c commit 536a5ca51466e3de0b19351dc826710a1e159cf5 @alex alex committed Jul 13, 2010
Showing with 4 additions and 0 deletions.
  1. +1 −0 django/contrib/mongodb/base.py
  2. +3 −0 tests/regressiontests/mongodb/tests.py
@@ -10,6 +10,7 @@
class DatabaseFeatures(object):
interprets_empty_strings_as_nulls = False
sql_nulls = False
+ related_fields_match_type = False
class DatabaseOperations(object):
@@ -82,6 +82,9 @@ def test_foreignkey(self):
self.assertEqual(b.current_group_id, e.pk)
self.assertFalse(hasattr(b, "_current_group_cache"))
self.assertEqual(b.current_group, e)
+
+ self.assertEqual(Artist.objects.get(current_group=e), b)
+ self.assertEqual(Artist.objects.get(current_group__id=e.pk), b)
def test_exists(self):
self.assertFalse(Artist.objects.filter(name="Brian May").exists())

0 comments on commit 536a5ca

Please sign in to comment.