'Helper method to check changes in tab visibility'

def check_toggle_tab_visiblity(self, tab_type, new_is_hidden_setting):

    old_tab = CourseTabList.get_tab_by_type(self.course.tabs, tab_type)
    self.assertNotEqual(old_tab.is_hidden, new_is_hidden_setting)
    resp = self.client.ajax_post(self.url, data=json.dumps({'tab_id_locator': {'tab_id': old_tab.tab_id}, 'is_hidden': new_is_hidden_setting}))
    self.assertEqual(resp.status_code, 204)
    self.reload_course()
    new_tab = CourseTabList.get_tab_by_type(self.course.tabs, tab_type)
    self.assertEqual(new_tab.is_hidden, new_is_hidden_setting)
