1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

Fixed #11319 - Added lookup support for ForeignKey.to_field. Also reverted no-longer-needed model formsets workaround for lack of such support from r10756. Thanks Russell and Alex for review.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer
2011-01-25 03:14:28 +00:00
parent 7c888a7aa9
commit 227c5e80db
8 changed files with 122 additions and 14 deletions

View File

@@ -158,11 +158,9 @@ class CustomPKTests(TestCase):
new_bar = Bar.objects.create()
new_foo = Foo.objects.create(bar=new_bar)
# FIXME: This still doesn't work, but will require some changes in
# get_db_prep_lookup to fix it.
# f = Foo.objects.get(bar=new_bar.pk)
# self.assertEqual(f, new_foo)
# self.assertEqual(f.bar, new_bar)
f = Foo.objects.get(bar=new_bar.pk)
self.assertEqual(f, new_foo)
self.assertEqual(f.bar, new_bar)
f = Foo.objects.get(bar=new_bar)
self.assertEqual(f, new_foo),