<s> from rest_framework . test import APITestCase <EOL> import json <EOL> from django . contrib . auth . models import User <EOL> class AuthTestCase ( APITestCase ) : <EOL> def setUp ( self ) : <EOL> self . user = User . objects . create ( username = "<STR_LIT>" ) <EOL> self . user . social_auth . create ( <EOL> provider = "<STR_LIT>" , <EOL> uid = "<STR_LIT>" , <EOL> ) <EOL> self . client . force_authenticate ( self . user ) <EOL> def test_auth_config_json ( self ) : <EOL> response = self . client . get ( '<STR_LIT>' ) <EOL> result = json . loads ( response . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . assertTrue ( "<STR_LIT>" in result [ '<STR_LIT>' ] ) <EOL> def test_auth_login_info ( self ) : <EOL> response = self . client . get ( '<STR_LIT>' ) <EOL> result = json . loads ( response . content . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . assertTrue ( "<STR_LIT:user>" in result ) <EOL> self . assertTrue ( "<STR_LIT>" in result [ '<STR_LIT:user>' ] ) <EOL> account = result [ '<STR_LIT:user>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> self . assertEqual ( account [ '<STR_LIT:label>' ] , "<STR_LIT>" ) <EOL> self . assertEqual ( account [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_auth_context_processors ( self ) : <EOL> response = self . client . get ( '<STR_LIT>' ) <EOL> result = response . content . decode ( '<STR_LIT:utf-8>' ) <EOL> self . assertHTMLEqual ( <EOL> result , <EOL> """<STR_LIT>""" <EOL> ) </s>
