#NEWLINE# def test_success( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# self . username : 'jsmith@example.com' , #NEWLINE# 'password1' : 'test123' , #NEWLINE# 'password2' : 'test123' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( settings . AUTH_USER_MODEL == 'authtools.User' ) : #NEWLINE# #INDENT# data [ 'name' ] = 'John Smith' #NEWLINE# #UNINDENT# form = UserCreationForm ( data ) #NEWLINE# self . assertTrue ( form . is_valid ( ) ) #NEWLINE# u = form . save ( ) #NEWLINE# self . assertEqual ( getattr ( u , self . username ) , 'jsmith@example.com' ) #NEWLINE# self . assertTrue ( u . check_password ( 'test123' ) ) #NEWLINE# self . assertEqual ( u , User . _default_manager . get_by_natural_key ( 'jsmith@example.com' ) )