MCPcopy
hub / github.com/getredash/redash / test_schedule_until_before

Method test_schedule_until_before

tests/test_models.py:300–311  ·  view source on GitHub ↗

Queries with non-null ``schedule['until']`` are reported by Query.outdated_queries() before the given time is past.

(self)

Source from the content-addressed store, hash-verified

298 self.assertNotIn(query, queries)
299
300 def test_schedule_until_before(self):
301 """
302 Queries with non-null ``schedule['until']`` are reported by
303 Query.outdated_queries() before the given time is past.
304 """
305 one_day_from_now = (utcnow() + datetime.timedelta(days=1)).strftime("%Y-%m-%d")
306 query = self.create_scheduled_query(interval="3600", until=one_day_from_now)
307 self.fake_previous_execution(query, hours=2)
308
309 queries = models.Query.outdated_queries()
310
311 self.assertIn(query, queries)
312
313 def test_skips_and_disables_faulty_queries(self):
314 faulty_query = self.create_scheduled_query(until="pigs fly")

Callers

nothing calls this directly

Calls 4

utcnowFunction · 0.90
outdated_queriesMethod · 0.80

Tested by

no test coverage detected