Skip to content

Commit

Permalink
fix(tests): flaky test with dttm on Query API (#11526)
Browse files Browse the repository at this point in the history
* fix(tests): flaky test wirh dttm on Query API
  • Loading branch information
dpgaspar committed Nov 3, 2020
1 parent 5e32235 commit 6f2e36d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/queries/api_tests.py
Expand Up @@ -65,6 +65,7 @@ def insert_query(
rows=rows,
tab_name=tab_name,
status=status,
changed_on=datetime(2020, 1, 1),
)
db.session.add(query)
db.session.commit()
Expand Down Expand Up @@ -326,12 +327,10 @@ def test_get_list_query_filter_changed_on(self):
Query API: Test get list query filter changed_on
"""
self.login(username="admin")
now_time = datetime.now()
yesterday_time = now_time - timedelta(days=1)
arguments = {
"filters": [
{"col": "changed_on", "opr": "lt", "value": str(now_time)},
{"col": "changed_on", "opr": "gt", "value": str(yesterday_time)},
{"col": "changed_on", "opr": "lt", "value": "2020-02-01T00:00:00Z"},
{"col": "changed_on", "opr": "gt", "value": "2019-12-30T00:00:00Z"},
]
}
uri = f"api/v1/query/?q={prison.dumps(arguments)}"
Expand Down

0 comments on commit 6f2e36d

Please sign in to comment.