'Helper method to create the user.'

def setup_user(self, admin=False, enroll=False, login=False):

    self.user = (AdminFactory() if admin else UserFactory())
    if enroll:
        CourseEnrollmentFactory(user=self.user, course_id=self.course.id)
    if login:
        self.login()
