'Tests the catalog visibility tri-states'

def test__catalog_visibility(self):

    user = UserFactory.create()
    course_id = CourseLocator('edX', 'test', '2012_Fall')
    staff = StaffFactory.create(course_key=course_id)
    course = Mock(id=course_id, catalog_visibility=CATALOG_VISIBILITY_CATALOG_AND_ABOUT)
    self.assertTrue(access._has_access_course(user, 'see_in_catalog', course))
    self.assertTrue(access._has_access_course(user, 'see_about_page', course))
    self.assertTrue(access._has_access_course(staff, 'see_in_catalog', course))
    self.assertTrue(access._has_access_course(staff, 'see_about_page', course))
    course = Mock(id=CourseLocator('edX', 'test', '2012_Fall'), catalog_visibility=CATALOG_VISIBILITY_ABOUT)
    self.assertFalse(access._has_access_course(user, 'see_in_catalog', course))
    self.assertTrue(access._has_access_course(user, 'see_about_page', course))
    self.assertTrue(access._has_access_course(staff, 'see_in_catalog', course))
    self.assertTrue(access._has_access_course(staff, 'see_about_page', course))
    course = Mock(id=CourseLocator('edX', 'test', '2012_Fall'), catalog_visibility=CATALOG_VISIBILITY_NONE)
    self.assertFalse(access._has_access_course(user, 'see_in_catalog', course))
    self.assertFalse(access._has_access_course(user, 'see_about_page', course))
    self.assertTrue(access._has_access_course(staff, 'see_in_catalog', course))
    self.assertTrue(access._has_access_course(staff, 'see_about_page', course))
