summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-11-10 15:21:12 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-11-10 15:21:12 +0000
commit70f9a4f6ceb1bc4a33714e3b1cfb99175e2fcf3f (patch)
tree843dd960cfc1d9869068f8b653e88f841ba7002b /tests
parentef65854a77493bc3be8056cfcf149ccc37409097 (diff)
Fixed #12190 -- Corrected a regression in the ability to instantiate ForeignKeys outside of models. Thanks to jittat for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/many_to_one_regress/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/many_to_one_regress/models.py b/tests/regressiontests/many_to_one_regress/models.py
index 3f35bef62c..d491f002c2 100644
--- a/tests/regressiontests/many_to_one_regress/models.py
+++ b/tests/regressiontests/many_to_one_regress/models.py
@@ -167,4 +167,10 @@ Traceback (most recent call last):
...
ValueError: Cannot assign "<Child: Child object>": "Child.parent" must be a "Parent" instance.
+# Regression for #12190 -- Should be able to instantiate a FK
+# outside of a model, and interrogate its related field.
+>>> cat = models.ForeignKey(Category)
+>>> cat.rel.get_related_field().name
+'id'
+
"""}