This is an automated email from the ASF dual-hosted git repository.
dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 6f2e36d fix(tests): flaky test with dttm on Query API (#11526)
6f2e36d is described below
commit 6f2e36dd1b63adc252485801ab1673ecf621dffa
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Tue Nov 3 09:01:17 2020 +0000
fix(tests): flaky test with dttm on Query API (#11526)
* fix(tests): flaky test wirh dttm on Query API
---
tests/queries/api_tests.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tests/queries/api_tests.py b/tests/queries/api_tests.py
index 91c4180..744aae1 100644
--- a/tests/queries/api_tests.py
+++ b/tests/queries/api_tests.py
@@ -65,6 +65,7 @@ class TestQueryApi(SupersetTestCase):
rows=rows,
tab_name=tab_name,
status=status,
+ changed_on=datetime(2020, 1, 1),
)
db.session.add(query)
db.session.commit()
@@ -326,12 +327,10 @@ class TestQueryApi(SupersetTestCase):
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)}"