#NEWLINE# def test_registration_signal( self ) : #NEWLINE# #INDENT# '\n        Test that registering a user sends the ``user_registered``\n        signal.\n        \n        ' #NEWLINE# def receiver( sender , **kwargs ) : #NEWLINE# #INDENT# self . failUnless ( ( 'user' in kwargs ) ) #NEWLINE# self . assertEqual ( kwargs [ 'user' ] . username , 'bob' ) #NEWLINE# self . failUnless ( ( 'request' in kwargs ) ) #NEWLINE# self . failUnless ( isinstance ( kwargs [ 'request' ] , WSGIRequest ) ) #NEWLINE# received_signals . append ( kwargs . get ( 'signal' ) ) #NEWLINE# #UNINDENT# received_signals = [ ] #NEWLINE# signals . user_registered . connect ( receiver , sender = received_signals . backend . __class__ ) #NEWLINE# self . backend . register ( _mock_request ( ) , username = 'bob' , email = 'bob@example.com' , password1 = 'secret' ) #NEWLINE# self . assertEqual ( len ( received_signals ) , 1 ) #NEWLINE# self . assertEqual ( received_signals , [ signals . user_registered ] )