#NEWLINE# def test_named_crop( self ) : #NEWLINE# #INDENT# self . create_area ( storage_path = self . base_image , x1 = 21 , x2 = 70 , y1 = 46 , y2 = 95 , name = 'area' ) #NEWLINE# expected = Image . open ( self . _data_path ( '25x25_fit_named_crop.png' ) ) #NEWLINE# with self . assertNumQueries ( 4 ) : #NEWLINE# #INDENT# helper = AdjustmentHelper ( [ self . base_image ] , generate = True ) #NEWLINE# helper . adjust ( 'namedcrop' , name = 'area' ) #NEWLINE# helper . adjust ( 'fit' , width = 25 , height = 25 ) #NEWLINE# helper . _finalize ( ) #NEWLINE# #UNINDENT# adjusted = AdjustedImage . objects . get ( ) #NEWLINE# self . assertImageEqual ( Image . open ( adjusted . adjusted . path ) , expected )