def login_as_admin(context, admin_name='admin', admin_pass='abc123'):
 if (not User.objects.filter(username=admin_name)):
  class ContextWithMixin(CreateAdminMixin, ):
   def __init__(self):
    self.browser = context.browser
  context_wm = ContextWithMixin()
  context_wm.create_admin(username=admin_name, password=admin_pass)
 _login_user(context, admin_name, admin_pass)

def login_as_admin ( context , admin_name = 'admin' , admin_pass = 'abc123' ) : if ( not User . objects . filter ( username = admin_name ) ) : class ContextWithMixin ( CreateAdminMixin , ) : def __init__ ( self ) : self . browser = context . browser context_wm = ContextWithMixin ( ) context_wm . create_admin ( username = admin_name , password = admin_pass ) _login_user ( context , admin_name , admin_pass )
log in as an admin specified by the optional arguments .