Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #18002 -- Fixed typo in attribute name in ReverseSingleRelatedO…

…bjectDescriptor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17904 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2cd516002d43cdc09741618f0a0db047ee6d78fd 1 parent 844e56e
Claude Paroz authored April 12, 2012
2  django/db/models/fields/related.py
@@ -364,7 +364,7 @@ def __get__(self, instance, instance_type=None):
4  tests/regressiontests/many_to_one_regress/tests.py
@@ -58,6 +58,10 @@ def test_fk_assignment_and_related_object_cache(self):
58 58
         self.assertRaises(ValueError, Child, name='xyzzy', parent=None)
59 59
         self.assertRaises(ValueError, Child.objects.create, name='xyzzy', parent=None)
60 60
 
  61
+        # Trying to assign to unbound attribute raises AttributeError
  62
+        self.assertRaisesRegexp(AttributeError, "must be accessed via instance",
  63
+            Child.parent.__set__, None, p)
  64
+
61 65
         # Creation using keyword argument should cache the related object.
62 66
         p = Parent.objects.get(name="Parent")
63 67
         c = Child(parent=p)

0 notes on commit 2cd5160

Please sign in to comment.
Something went wrong with that request. Please try again.