'Ensure course team users are allowed to access only their own course.'

def test_gitlog_courseteam_access(self):

    self._mkdir(settings.GIT_REPO_DIR)
    self._setstaff_login()
    self._add_edx4edx()
    self.user.is_staff = False
    self.user.save()
    logged_in = self.client.login(username=self.user.username, password='foo')
    response = self.client.get(reverse('gitlogs'))
    self.assertEqual(response.status_code, 404)
    response = self.client.get(reverse('gitlogs_detail', kwargs={'course_id': 'MITx/edx4edx/edx4edx'}))
    self.assertEqual(response.status_code, 404)
    def_ms = modulestore()
    course = def_ms.get_course(CourseKey.from_string('MITx/edx4edx/edx4edx'))
    CourseStaffRole(course.id).add_users(self.user)
    self.assertTrue(CourseStaffRole(course.id).has_user(self.user))
    logged_in = self.client.login(username=self.user.username, password='foo')
    self.assertTrue(logged_in)
    response = self.client.get(reverse('gitlogs_detail', kwargs={'course_id': 'MITx/edx4edx/edx4edx'}))
    self.assertIn('======&gt;    IMPORTING    course', response.content)
    self._rm_edx4edx()
