kolibri/plugins/coach/test/helpers.py
def create_learner(username, password, facility, classroom=None, learner_group=None):
    """
    Create a facility learner.
    Assign them a classroom if specified.
    Assign them a learner group if specified.
    """

    learner = FacilityUser.objects.create(username=username, facility=facility)
    learner.set_password(password)
    learner.save()

    if classroom is not None:
        classroom.add_member(learner)

    if learner_group is not None:
        learner_group.add_member(learner)

    return learner

    Create a facility learner.
    Assign them a classroom if specified.
    Assign them a learner group if specified.
    
Create a facility learner.
Assign them a classroom if specified.
Assign them a learner group if specified.
Create a facility learner . Assign them a classroom if specified . Assign them a learner group if specified .
def create_learner(username, password, facility, classroom=None, learner_group=None):
    learner = FacilityUser.objects.create(username=username, facility=facility)
    learner.set_password(password)
    learner.save()
    if classroom is not None:
        classroom.add_member(learner)
    if learner_group is not None:
        learner_group.add_member(learner)
    return learner
def create_learner ( username , password , facility , classroom = None , learner_group = None ) : learner = FacilityUser . objects . create ( username = username , facility = facility ) learner . set_password ( password ) learner . save ( ) if classroom is not None : classroom . add_member ( learner ) if learner_group is not None : learner_group . add_member ( learner ) return learner
Create a facility learner.
Create a facility learner .
"""
    Create a facility learner.
    Assign them a classroom if specified.
    Assign them a learner group if specified.
    """
username
password
facility
classroom
learner_group