(self)
| 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 |
nothing calls this directly
no test coverage detected