Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for accessing nullable ForeignKey after saving and fetchi…

…ng from the database (refs #8093).

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3d918f41f50f1f1f756adbc77ed9575d6b475166 1 parent cd3def1
@gdub gdub authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/regressiontests/many_to_one_regress/
10 tests/regressiontests/many_to_one_regress/
@@ -84,6 +84,16 @@ def __unicode__(self):
>>> p.bestchild is None
+# bestchild should still be None after saving.
+>>> p.bestchild is None
+# bestchild should still be None after fetching the object again.
+>>> p = Parent.objects.get(name="Parent")
+>>> p.bestchild is None
# Assigning None fails: Child.parent is null=False.
>>> c.parent = None
Traceback (most recent call last):
Please sign in to comment.
Something went wrong with that request. Please try again.