def setup_users():
 from django.core.cache import cache
 global TEST_USER_OBJECTS
 if (TEST_USER_OBJECTS is None):
  key = 'test_user_objects'
  user_objects = cache.get(key)
  if ((not user_objects) or TEST_USER_FORCE_CREATE):
   logger.info('test user cache not found, rebuilding')
   user_objects = {}
   app_token = FacebookAuthorization.get_app_access_token()
   for (user_slug, user_dict) in TEST_USER_DICT.items():
    test_user = FacebookAuthorization.get_or_create_test_user(app_token, name=user_dict['name'], force_create=TEST_USER_FORCE_CREATE, permissions=user_dict.get('permissions'))
    user_objects[user_slug] = test_user
   cache.set(key, user_objects, (60 * 60))
  TEST_USER_OBJECTS = user_objects
 return TEST_USER_OBJECTS

def setup_users ( ) : from django . core . cache import cache global TEST_USER_OBJECTS if ( TEST_USER_OBJECTS is None ) : key = 'test_user_objects' user_objects = cache . get ( key ) if ( ( not user_objects ) or TEST_USER_FORCE_CREATE ) : logger . info ( 'test user cache not found, rebuilding' ) user_objects = { } app_token = FacebookAuthorization . get_app_access_token ( ) for ( user_slug , user_dict ) in TEST_USER_DICT . items ( ) : test_user = FacebookAuthorization . get_or_create_test_user ( app_token , name = user_dict [ 'name' ] , force_create = TEST_USER_FORCE_CREATE , permissions = user_dict . get ( 'permissions' ) ) user_objects [ user_slug ] = test_user cache . set ( key , user_objects , ( 60 * 60 ) ) TEST_USER_OBJECTS = user_objects return TEST_USER_OBJECTS
since this is soo slow we only do this once for all tests .