MCPcopy
hub / github.com/lektor/lektor / _iterate

Method _iterate

tests/test_db.py:261–271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

259
260 class TestQuery(Query):
261 def _iterate(self):
262 for day, pub_date in [
263 (3, "2016-01-03"),
264 (4, None), # No pub_date.
265 (1, "2016-01-01"),
266 (2, "2016-01-02"),
267 ]:
268 yield pad.instance_from_data(
269 {"_id": str(day), "_path": "test/%s" % day, "pub_date": pub_date},
270 datamodel=blog_post,
271 )
272
273 ids = [c["_id"] for c in TestQuery("test", pad).order_by("pub_date")]
274 assert ["4", "1", "2", "3"] == ids

Callers

nothing calls this directly

Calls 1

instance_from_dataMethod · 0.80

Tested by

no test coverage detected