MCPcopy
hub / github.com/pallets/flask / test_endpoint_override

Function test_endpoint_override

tests/test_views.py:171–186  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

169
170
171def test_endpoint_override(app):
172 app.debug = True
173
174 class Index(flask.views.View):
175 methods = ["GET", "POST"]
176
177 def dispatch_request(self):
178 return flask.request.method
179
180 app.add_url_rule("/", view_func=Index.as_view("index"))
181
182 with pytest.raises(AssertionError):
183 app.add_url_rule("/", view_func=Index.as_view("index"))
184
185 # But these tests should still pass. We just log a warning.
186 common_test(app)
187
188
189def test_methods_var_inheritance(app, client):

Callers

nothing calls this directly

Calls 3

common_testFunction · 0.85
as_viewMethod · 0.80
add_url_ruleMethod · 0.45

Tested by

no test coverage detected