MCPcopy
hub / github.com/jarun/buku / assert_failure_alert

Function assert_failure_alert

tests/test_views.py:138–140  ·  view source on GitHub ↗
(dom, edit)

Source from the content-addressed store, hash-verified

136 assert dom.xpath(f'//script[contains(., "const SUCCESS = [")][contains(., "{message}")][contains(., "/bookmark/details/?id={id}&")]')
137
138def assert_failure_alert(dom, edit):
139 assert dom.xpath(xpath_alert('danger', f'Failed to {"update" if edit else "create"} record. Duplicate URL')), 'alert missing'
140 assert not dom.xpath('//script[contains(., "const SUCCESS = [")][contains(., "/bookmark/details/?id=")]')
141
142def assert_response(response, uri, *, status=200, argnames=None, args=None):
143 assert response.status_code == status

Callers 2

test_create_duplicateFunction · 0.85
test_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected