<s> from django . test . utils import override_settings <EOL> from django . core . urlresolvers import reverse <EOL> from allauth . utils import get_user_model <EOL> from allauth . tests import TestCase , patch <EOL> SOCIALACCOUNT_PROVIDERS = { '<STR_LIT>' : <EOL> { '<STR_LIT>' : '<STR_LIT>' } } <EOL> class PersonaTests ( TestCase ) : <EOL> @ override_settings ( SOCIALACCOUNT_PROVIDERS = SOCIALACCOUNT_PROVIDERS ) <EOL> def test_login ( self ) : <EOL> with patch ( '<STR_LIT>' <EOL> '<STR_LIT>' ) as requests_mock : <EOL> requests_mock . post . return_value . json . return_value = { <EOL> '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT:email>' : '<STR_LIT>' <EOL> } <EOL> resp = self . client . post ( reverse ( '<STR_LIT>' ) , <EOL> dict ( assertion = '<STR_LIT>' ) ) <EOL> self . assertRedirects ( resp , '<STR_LIT>' , <EOL> fetch_redirect_response = False ) <EOL> get_user_model ( ) . objects . get ( email = '<STR_LIT>' ) </s>
