Django

Code

Changeset 8198

Show
Ignore:
Timestamp:
08/02/08 22:03:46 (4 months ago)
Author:
gwilson
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/many_to_one_regress/models.py

    r8185 r8198  
    8585True 
    8686 
     87# bestchild should still be None after saving. 
     88>>> p.save() 
     89>>> p.bestchild is None 
     90True 
     91 
     92# bestchild should still be None after fetching the object again. 
     93>>> p = Parent.objects.get(name="Parent") 
     94>>> p.bestchild is None 
     95True 
     96 
    8797# Assigning None fails: Child.parent is null=False. 
    8898>>> c.parent = None