#NEWLINE# def test_item_fields_default( self ) : #NEWLINE# #INDENT# class TestItem ( Item ) : #NEWLINE# #INDENT# name = Field ( ) #NEWLINE# image_urls = Field ( ) #NEWLINE# images = Field ( ) #NEWLINE# #UNINDENT# for cls in ( TestItem , dict ) : #NEWLINE# #INDENT# url = 'http://www.example.com/images/1.jpg' #NEWLINE# item = cls ( { #NEWLINE# #INDENT# 'name' : 'item1' , #NEWLINE# 'image_urls' : [ url ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# pipeline = ImagesPipeline . from_settings ( Settings ( { #NEWLINE# #INDENT# 'IMAGES_STORE' : 's3://example/images/' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# requests = list ( pipeline . get_media_requests ( item , None ) ) #NEWLINE# self . assertEqual ( requests [ 0 ] . url , url ) #NEWLINE# results = [ ( True , { #NEWLINE# #INDENT# 'url' : url , #NEWLINE# #UNINDENT# } ) ] #NEWLINE# pipeline . item_completed ( results , item , None ) #NEWLINE# self . assertEqual ( results [ 'images' ] , [ results [ 0 ] [ 1 ] ] )