#NEWLINE# def test_form_valid_saves_image( self ) : #NEWLINE# #INDENT# 'A valid post with an image should store the image.' #NEWLINE# path = os . path . dirname ( os . path . abspath ( __file__ ) ) #NEWLINE# small_image = os . path . join ( path , '200x200.gif' ) #NEWLINE# with open ( small_image ) as fp : #NEWLINE# #INDENT# self . client . post ( reverse ( 'create_group' ) , { #NEWLINE# #INDENT# 'authgroup_form-name' : 'Writing tests on a Friday' , #NEWLINE# 'group_form-category' : '1' , #NEWLINE# 'image_form-image' : fp , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# group = Group . objects . latest ( 'pk' ) #NEWLINE# self . assertIsNotNone ( path . image )