'Add a user and a course'

def setUp(self):

    super(TestCourseListing, self).setUp()
    self.user = UserFactory()
    self.factory = RequestFactory()
    self.client = AjaxEnabledTestClient()
    self.client.login(username=self.user.username, password='test')
    self.course_create_rerun_url = reverse('course_handler')
    source_course = CourseFactory.create(org='origin', number='the_beginning', run='first', display_name='the    one    and    only', start=datetime.utcnow())
    self.source_course_key = source_course.id
    for role in [CourseInstructorRole, CourseStaffRole]:
        role(self.source_course_key).add_users(self.user)
