#NEWLINE# def test_both_passwords( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# self . username : 'jsmith' , #NEWLINE# #UNINDENT# } #NEWLINE# form = UserCreationForm ( data ) #NEWLINE# required_error = [ force_text ( Field . default_error_messages [ 'required' ] ) ] #NEWLINE# self . assertFalse ( form . is_valid ( ) ) #NEWLINE# self . assertEqual ( form [ 'password1' ] . errors , required_error ) #NEWLINE# self . assertEqual ( form [ 'password2' ] . errors , required_error ) #NEWLINE# data [ 'password2' ] = 'test123' #NEWLINE# form = UserCreationForm ( required_error ) #NEWLINE# self . assertFalse ( form . is_valid ( ) ) #NEWLINE# self . assertEqual ( form [ 'password1' ] . errors , required_error ) #NEWLINE# self . assertEqual ( form [ 'password2' ] . errors , [ ] )