#NEWLINE# def test_should_invite_user( self ) : #NEWLINE# #INDENT# invited_user = self . _invite_user ( ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 1 ) #NEWLINE# message = mail . outbox [ 0 ] #NEWLINE# self . assertIn ( self . invited_user_email , message . to ) #NEWLINE# self . assertEqual ( message . subject , 'Invitation to Create Account at testserver' ) #NEWLINE# invitation_complete_url = self . _get_invitation_complete_url ( invited_user ) #NEWLINE# self . assertIn ( response2 , message . body ) #NEWLINE# response2 = self . client . get ( invitation_complete_url ) #NEWLINE# self . assertIsInstance ( response2 . context_data [ 'form' ] , InvitationCompleteForm )