#NEWLINE# def test_save_related_object_if_none( self ) : #NEWLINE# #INDENT# with mock . patch . object ( objects . Instance , '_save_pci_requests' ) as save_mock : #NEWLINE# #INDENT# inst = objects . Instance ( ) #NEWLINE# inst = objects . Instance . _from_db_object ( self . context , inst , save_mock . fake_instance ) #NEWLINE# inst . pci_requests = None #NEWLINE# inst . save ( ) #NEWLINE# self . assertTrue ( save_mock . called )