def test_alerts(web_fixture): """An alert is used to display a message with a specific severity""" alert = Alert(web_fixture.view, 'Be careful', 'danger') assert alert.get_attribute('class') == 'alert alert-danger' assert alert.get_attribute('role') == 'alert' [message] = alert.children assert message.value == 'Be careful'
def alerts(fixture): """An alert is used to display a message with a specific severity""" alert = Alert(fixture.view, 'Be careful', 'danger') vassert( alert.get_attribute('class') == 'alert alert-danger' ) vassert( alert.get_attribute('role') == 'alert' ) [message] = alert.children vassert( message.value == 'Be careful' )