def login_as_learner(context, learner_name='mrpibb', learner_pass='abc123'):
 if (not FacilityUser.objects.filter(username=learner_name)):
  class ContextWithMixin(FacilityMixins, ):
   def __init__(self):
    self.browser = context.browser
  context_wm = ContextWithMixin()
  context_wm.create_student(username=learner_name, password=learner_pass)
 facility = FacilityUser.objects.get(username=learner_name).facility.id
 _login_user(context, learner_name, learner_pass, facility=facility)

def login_as_learner ( context , learner_name = 'mrpibb' , learner_pass = 'abc123' ) : if ( not FacilityUser . objects . filter ( username = learner_name ) ) : class ContextWithMixin ( FacilityMixins , ) : def __init__ ( self ) : self . browser = context . browser context_wm = ContextWithMixin ( ) context_wm . create_student ( username = learner_name , password = learner_pass ) facility = FacilityUser . objects . get ( username = learner_name ) . facility . id _login_user ( context , learner_name , learner_pass , facility = facility )
log in as a learner specified by the optional arguments .