#NEWLINE# @ skipUnless ( ( django . VERSION >= ( 1 , 5 , 0 ) ) , "Django 1.4 doesn't have update_fields" ) #NEWLINE# def test_update_fields( self ) : #NEWLINE# #INDENT# self . update_instance ( name = 'retro' , number = 4 , mutable = [ 1 , 2 , 3 ] ) #NEWLINE# self . assertChanged ( ) #NEWLINE# self . instance . name = 'new age' #NEWLINE# self . instance . number = 8 #NEWLINE# self . instance . mutable = [ 4 , 5 , 6 ] #NEWLINE# self . assertChanged ( name = 'retro' , number = 4 , mutable = [ 1 , 2 , 3 ] ) #NEWLINE# self . instance . save ( update_fields = [ ] ) #NEWLINE# self . assertChanged ( name = 'retro' , number = 4 , mutable = [ 1 , 2 , 3 ] ) #NEWLINE# self . instance . save ( update_fields = [ 'name' ] ) #NEWLINE# in_db = self . tracked_class . objects . get ( id = self . instance . id ) #NEWLINE# self . assertEqual ( in_db . name , self . instance . name ) #NEWLINE# self . assertNotEqual ( in_db . number , self . instance . number ) #NEWLINE# self . assertChanged ( number = 4 , mutable = [ 1 , 2 , 3 ] ) #NEWLINE# self . instance . save ( update_fields = [ 'number' ] ) #NEWLINE# self . assertChanged ( mutable = [ 1 , 2 , 3 ] ) #NEWLINE# self . instance . save ( update_fields = [ 'mutable' ] ) #NEWLINE# self . assertChanged ( ) #NEWLINE# in_db = self . tracked_class . objects . get ( id = self . instance . id ) #NEWLINE# self . assertEqual ( in_db . name , self . instance . name ) #NEWLINE# self . assertEqual ( in_db . number , self . instance . number ) #NEWLINE# self . assertEqual ( in_db . mutable , self . instance . mutable )