'Verify that the instructor tab appears for staff only.'

def test_instructor_tab(self):

    def has_instructor_tab(user, course):
        'Returns    true    if    the    "Instructor"    tab    is    shown.'
        request = RequestFactory().request()
        request.user = user
        tabs = get_course_tab_list(request, course)
        return (len([tab for tab in tabs if (tab.name == 'Instructor')]) == 1)
    self.assertTrue(has_instructor_tab(self.instructor, self.course))
    staff = StaffFactory(course_key=self.course.id)
    self.assertTrue(has_instructor_tab(staff, self.course))
    student = UserFactory.create()
    self.assertFalse(has_instructor_tab(student, self.course))
