#NEWLINE# @ mock . patch ( 'thumbnails.get_thumbnail' ) #NEWLINE# def test_get_thumbnail_templatetag_with_FileField_as_source( self , mock_get_thumbnail ) : #NEWLINE# #INDENT# field = files . FileField ( ) #NEWLINE# _file = files . FieldFile ( field = mock_get_thumbnail , instance = None , name = 'image.jpg' ) #NEWLINE# Template ( '{% load thumbnails %}{% get_thumbnail image "200x200" as im %}{{im.url}}' ) . render ( Context ( { #NEWLINE# #INDENT# 'image' : _file , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# mock_get_thumbnail . assert_called_once_with ( _file , '200x200' )