#NEWLINE# def test_readjust( self ) : #NEWLINE# #INDENT# '\n        Adjusting a previously-adjusted image should return the previous\n        adjustment.\n\n        ' #NEWLINE# new_im = Image . open ( self . _data_path ( '50x100_crop.png' ) ) #NEWLINE# with self . assertNumQueries ( 4 ) : #NEWLINE# #INDENT# helper = AdjustmentHelper ( [ self . base_image ] , generate = True ) #NEWLINE# helper . adjust ( 'crop' , width = 50 , height = 100 ) #NEWLINE# helper . _finalize ( ) #NEWLINE# #UNINDENT# adjusted = AdjustedImage . objects . get ( ) #NEWLINE# self . assertImageEqual ( Image . open ( adjusted . adjusted . path ) , new_im ) #NEWLINE# with self . assertNumQueries ( 1 ) : #NEWLINE# #INDENT# helper = AdjustmentHelper ( [ self . base_image ] , generate = True ) #NEWLINE# helper . adjust ( 'crop' , width = 50 , height = 100 ) #NEWLINE# helper . _finalize ( ) #NEWLINE# #UNINDENT# self . assertEqual ( AdjustedImage . objects . count ( ) , 1 )