#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# from django_facebook.test_utils.mocks import MockFacebookAPI , MockFacebookAuthorization , RequestMock #NEWLINE# import sys #NEWLINE# self . prints = sys . stdout = StringIO ( ) #NEWLINE# from open_facebook import api #NEWLINE# import open_facebook #NEWLINE# self . originalAPI = open_facebook . OpenFacebook #NEWLINE# self . originalAuthorization = open_facebook . FacebookAuthorization #NEWLINE# open_facebook . OpenFacebook = api . OpenFacebook = MockFacebookAPI #NEWLINE# open_facebook . FacebookAuthorization = api . FacebookAuthorization = MockFacebookAuthorization #NEWLINE# rf = RequestMock ( ) #NEWLINE# self . request = rf . get ( '/' ) #NEWLINE# self . client = Client ( ) #NEWLINE# user_model = get_user_model ( ) #NEWLINE# user_dict = dict ( username = 'tschellenbach' , is_staff = False , is_active = True , email = 'fake@mellowmorning.com' ) #NEWLINE# test_ip = '127.0.0.1' #NEWLINE# if is_user_attribute ( 'registration_ip' ) : #NEWLINE# #INDENT# user_dict [ 'registration_ip' ] = test_ip #NEWLINE# user_dict [ 'last_login_ip' ] = test_ip #NEWLINE# #UNINDENT# user_model . objects . create ( ** user_dict ) #NEWLINE# from django.conf import settings #NEWLINE# if ( getattr ( settings , 'MODE' , None ) == 'userena' ) : #NEWLINE# #INDENT# from django.core.management import call_command #NEWLINE# call_command ( 'check_permissions' , output = False )