#NEWLINE# def test_invalid_change_username_form( client ) : #NEWLINE# #INDENT# print ( 'test_invalid_change_username_form' ) #NEWLINE# um = current_app . user_manager #NEWLINE# um . enable_username = True #NEWLINE# um . enable_email = False #NEWLINE# username = 'user1' #NEWLINE# password = 'Password1' #NEWLINE# new_username = 'user4' #NEWLINE# url = url_for ( 'user.change_username' ) #NEWLINE# client . login ( username = username , password = password ) #NEWLINE# client . post_invalid_form ( um , 'Username is required' , new_username = '' , old_password = password ) #NEWLINE# client . post_invalid_form ( url , 'Username must be at least 3 characters long' , new_username = SHORT_USERNAME , old_password = password ) #NEWLINE# client . post_invalid_form ( url , 'This Username is already in use. Please try another one.' , new_username = 'user3' , old_password = password ) #NEWLINE# client . post_invalid_form ( url , 'Old Password is required' , new_username = username , old_password = '' ) #NEWLINE# client . post_invalid_form ( url , 'Old Password is incorrect' , new_username = username , old_password = 'XPassword1' ) #NEWLINE# client . logout ( )