#NEWLINE# def test_save( self ) : #NEWLINE# #INDENT# "Test the form's save method consumes an invite." #NEWLINE# invite = mommy . make ( 'accounts.Invite' ) #NEWLINE# self . assertFalse ( invite . consumed_at ) #NEWLINE# self . assertFalse ( invite . consumed_by ) #NEWLINE# form = forms . InviteEntryForm ( { #NEWLINE# #INDENT# 'invite_code' : invite . code , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( form . is_valid ( ) ) #NEWLINE# user = mommy . make ( 'accounts.User' ) #NEWLINE# form . user_id = form . pk #NEWLINE# form . save ( ) #NEWLINE# invite = Invite . objects . get ( pk = invite . pk ) #NEWLINE# self . assertTrue ( invite . consumed_at ) #NEWLINE# self . assertEqual ( invite . consumed_by , user )