Skip to content

Instantly share code, notes, and snippets.

@washort
Last active October 25, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save washort/470a6703a68a412a8f963b5e691b4daf to your computer and use it in GitHub Desktop.
Save washort/470a6703a68a412a8f963b5e691b4daf to your computer and use it in GitHub Desktop.
======================================================================
FAIL: test_get_latest_returns_when_found (tests.test_models.QueryResultTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/washort/Projects/redash/tests/test_models.py", line 337, in test_get_latest_returns_when_found
self.assertEqual(qr, found_query_result)
AssertionError: <QueryResult: u'1 | f6bf37efedbc0a2dfffc1caf5088d86e | 2016-10-25 15:22:01.354496+00:00'> != None
@@ -519,7 +519,7 @@ class QueryResult(BaseModel, BelongsToOrgMixin):
cls.data_source == data_source).order_by(cls.retrieved_at.desc())
else:
query = cls.select().where(cls.query_hash == query_hash, cls.data_source == data_source,
- peewee.SQL("retrieved_at + interval '%s second' >= now() at time zone 'utc'",
+ peewee.SQL("retrieved_at at time zone 'utc' + interval '%s second' >= now() at time zone 'utc'",
max_age)).order_by(cls.retrieved_at.desc())
return query.first()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment