Kaydet (Commit) 3d918f41 authored tarafından Gary Wilson Jr's avatar Gary Wilson Jr

Added tests for accessing nullable ForeignKey after saving and fetching from the…

Added tests for accessing nullable ForeignKey after saving and fetching from the database (refs #8093).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst cd3def1e
......@@ -84,6 +84,16 @@ True
>>> p.bestchild is None
True
# bestchild should still be None after saving.
>>> p.save()
>>> p.bestchild is None
True
# bestchild should still be None after fetching the object again.
>>> p = Parent.objects.get(name="Parent")
>>> p.bestchild is None
True
# Assigning None fails: Child.parent is null=False.
>>> c.parent = None
Traceback (most recent call last):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment