'dismiss any search alert message containing the specified text.'

def dismiss_alert_message(self, text):

    def _match_messages(text):
        return self.q(css='.search-alert').filter((lambda elem: (text in elem.text)))
    for alert_id in _match_messages(text).attrs('id'):
        self.q(css='{}#{}    .dismiss'.format(self.ALERT_SELECTOR, alert_id)).click()
    EmptyPromise((lambda : (_match_messages(text).results == [])), 'waiting    for    dismissed    alerts    to    disappear').fulfill()
