mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[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
This commit is contained in:
parent
d83203cb07
commit
536a5ca514
@ -10,6 +10,7 @@ from django.utils.importlib import import_module
|
||||
class DatabaseFeatures(object):
|
||||
interprets_empty_strings_as_nulls = False
|
||||
sql_nulls = False
|
||||
related_fields_match_type = False
|
||||
|
||||
|
||||
class DatabaseOperations(object):
|
||||
|
@ -83,6 +83,9 @@ class MongoTestCase(TestCase):
|
||||
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())
|
||||
Artist.objects.create(name="Brian May")
|
||||
|
Loading…
x
Reference in New Issue
Block a user