'Make sure that you can search courses.'

def test_search(self):

    search_string = 'dashboard'
    html_content = 'dashboard    search'
    for course_info in [self.courses['A'], self.courses['B']]:
        course_key = generate_course_key(course_info['org'], course_info['number'], course_info['run'])
        AutoAuthPage(self.browser, username=self.USERNAME, email=self.EMAIL, course_id=course_key).visit()
    self._auto_auth(self.STAFF_USERNAME, self.STAFF_EMAIL, True)
    self._studio_add_content(self.studio_course_outlines['A'], html_content)
    self._studio_add_content(self.studio_course_outlines['B'], html_content)
    self._studio_add_content(self.studio_course_outlines['C'], html_content)
    self._auto_auth(self.USERNAME, self.EMAIL, False)
    self.dashboard.visit()
    self.dashboard.search_for_term(search_string)
    assert (search_string not in self.dashboard.search_results.html[0])
    self._auto_auth(self.STAFF_USERNAME, self.STAFF_EMAIL, True)
    self._studio_publish_content(self.studio_course_outlines['A'])
    self._studio_publish_content(self.studio_course_outlines['B'])
    self._studio_publish_content(self.studio_course_outlines['C'])
    self._auto_auth(self.USERNAME, self.EMAIL, False)
    self.dashboard.visit()
    self.dashboard.search_for_term(search_string)
    assert (self.dashboard.search_results.html[0].count(search_string) == 2)
    assert (self.dashboard.search_results.html[0].count(self.courses['A']['display_name']) == 1)
    assert (self.dashboard.search_results.html[0].count(self.courses['B']['display_name']) == 1)
