#NEWLINE# def test_node_save_after_tree_restructuring_with_update_fields( self ) : #NEWLINE# #INDENT# '\n        Test that model is saved properly when passing update_fields\n        ' #NEWLINE# carrot = ConcreteModel . objects . get ( id = 6 ) #NEWLINE# self . _modify_tree ( ) #NEWLINE# carrot . name = "Won't change" #NEWLINE# carrot . ghosts = 'Will get updated' #NEWLINE# carrot . save ( update_fields = [ 'ghosts' ] ) #NEWLINE# self . _assert_modified_tree_state ( ) #NEWLINE# updated_carrot = ConcreteModel . objects . get ( id = 6 ) #NEWLINE# self . assertEqual ( updated_carrot . ghosts , carrot . ghosts ) #NEWLINE# self . assertNotEqual ( updated_carrot . name , carrot . name ) #NEWLINE# carrot . name = 'Will change' #NEWLINE# carrot . ghosts = 'Will not be updated' #NEWLINE# carrot . save ( False , False , None , [ 'name' ] ) #NEWLINE# updated_carrot = ConcreteModel . objects . get ( id = 6 ) #NEWLINE# self . assertNotEqual ( updated_carrot . ghosts , carrot . ghosts ) #NEWLINE# self . assertEqual ( updated_carrot . name , carrot . name )