<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import datetime <EOL> from flask import current_app , url_for <EOL> user1 = None <EOL> def test_multiple_emails ( app , db , client ) : <EOL> """<STR_LIT>""" <EOL> um = current_app . user_manager <EOL> um . enable_register = True <EOL> um . enable_username = False <EOL> um . enable_email = True <EOL> um . enable_confirm_email = True <EOL> um . enable_change_username = False <EOL> um . enable_change_password = False <EOL> um . enable_forgot_password = False <EOL> um . enable_multiple_emails = True <EOL> um . enable_retype_password = False <EOL> um . db_adapter . UserEmailClass = app . UserEmailClass <EOL> app . add_url_rule ( um . email_action_url , '<STR_LIT>' , um . email_action_view_function ) <EOL> app . add_url_rule ( um . manage_emails_url , '<STR_LIT>' , um . manage_emails_view_function , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> EMAIL1 = '<STR_LIT>' <EOL> EMAIL2 = '<STR_LIT>' <EOL> PASSWORD = '<STR_LIT>' <EOL> response = client . post_valid_form ( url_for ( '<STR_LIT>' ) , email = EMAIL1 , password = PASSWORD ) <EOL> user_email1 = um . db_adapter . UserEmailClass . query . filter ( um . db_adapter . UserEmailClass . email == EMAIL1 ) . first ( ) <EOL> assert user_email1 != None <EOL> confirmation_token = um . generate_token ( user_email1 . id ) <EOL> client . get_valid_page ( url_for ( '<STR_LIT>' , token = confirmation_token ) ) <EOL> client . login ( email = EMAIL1 , password = PASSWORD ) <EOL> response = client . get_valid_page ( url_for ( '<STR_LIT>' ) ) <EOL> assert response . data . find ( str . encode ( EMAIL1 ) ) >= <NUM_LIT:0> <EOL> response = client . post_valid_form ( url_for ( '<STR_LIT>' ) , email = EMAIL2 ) <EOL> assert response . data . find ( str . encode ( EMAIL1 ) ) >= <NUM_LIT:0> <EOL> assert response . data . find ( str . encode ( EMAIL2 ) ) >= <NUM_LIT:0> <EOL> user_email2 = um . db_adapter . UserEmailClass . query . filter ( um . db_adapter . UserEmailClass . email == EMAIL2 ) . first ( ) <EOL> assert user_email2 != None <EOL> confirmation_token = um . generate_token ( user_email2 . id ) <EOL> client . get_valid_page ( url_for ( '<STR_LIT>' , token = confirmation_token ) ) <EOL> client . logout ( ) <EOL> client . login ( email = EMAIL1 , password = PASSWORD ) <EOL> client . logout ( ) <EOL> client . login ( email = EMAIL2 , password = PASSWORD ) <EOL> response = client . get_valid_page ( url_for ( '<STR_LIT>' , id = user_email2 . id , action = '<STR_LIT>' ) ) <EOL> response = client . get_valid_page ( url_for ( '<STR_LIT>' , id = user_email2 . id , action = '<STR_LIT>' ) ) <EOL> response = client . get_valid_page ( url_for ( '<STR_LIT>' , id = user_email1 . id , action = '<STR_LIT>' ) ) <EOL> client . logout ( ) <EOL> um . enable_multiple_emails = False <EOL> um . enable_confirm_email = True <EOL> um . enable_retype_password = True <EOL> um . db_adapter . UserEmailClass = None </s>
