'Checks can display results for various users'

def check_can_display_results(self, tab, expected_value=True, for_authenticated_users_only=False, for_staff_only=False, for_enrolled_users_only=False):

    if for_staff_only:
        user = self.create_mock_user(is_authenticated=True, is_staff=True, is_enrolled=True)
        self.assertEquals(expected_value, self.is_tab_enabled(tab, self.course, user))
    if for_authenticated_users_only:
        user = self.create_mock_user(is_authenticated=True, is_staff=False, is_enrolled=False)
        self.assertEquals(expected_value, self.is_tab_enabled(tab, self.course, user))
    if ((not for_staff_only) and (not for_authenticated_users_only) and (not for_enrolled_users_only)):
        user = self.create_mock_user(is_authenticated=False, is_staff=False, is_enrolled=False)
        self.assertEquals(expected_value, self.is_tab_enabled(tab, self.course, user))
    if for_enrolled_users_only:
        user = self.create_mock_user(is_authenticated=True, is_staff=False, is_enrolled=True)
        self.assertEquals(expected_value, self.is_tab_enabled(tab, self.course, user))
