I believe that delete() only deletes the reference to the object in the database, but does not affect the calling object in memory.
I think the reason for this is so that you can perform a delete operation, and if successful, gather information about the deleted object to display a confirmation message to the user (which may be computationally expensive, so you wouldn't want to run it unless the operation was successful). You would need to reload the parent object again for the deletion to be effective from a Python/Django perspective, similar to what you do at the end of your test code.
-James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOwivZTuFJ92G_BoFPSZTq_jZoeeeXoEC-uWGu1fnYXMt37Cmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.