Example #1
0
def create(n, course_key):
    """Create n users, enrolling them in course_key if it's not None"""
    for i in range(n):
        (user, user_profile,
         _) = _do_create_account(get_random_post_override())
        if course_key is not None:
            CourseEnrollment.enroll(user, course_key)
def create(n, course_id):
    """Create n users, enrolling them in course_id if it's not None"""
    for i in range(n):
        (user, user_profile, _) = _do_create_account(
            get_random_post_override())
        if course_id is not None:
            CourseEnrollment.objects.create(user=user, course_id=course_id)
def create(num, course_key):
    """Create num users, enrolling them in course_key if it's not None"""
    for idx in range(num):
        (user, user_profile, __) = _do_create_account(get_random_post_override())
        if course_key is not None:
            CourseEnrollment.enroll(user, course_key)