bugfix: query doesn't work well with period=1
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Wed, 19 Jul 2017 05:29:53 +0000 (13:29 +0800)
committerSerenaFeng <feng.xiaowei@zte.com.cn>
Wed, 19 Jul 2017 05:29:53 +0000 (13:29 +0800)
commit39fda4fb3d59b471e4d58e9929969a3c3ccc5387
tree95038120596e06432b9e6c37cfd496c8b8f2fca7
parentbba00ca773c4851de91ab19d34859b930b9e1960
bugfix: query doesn't work well with period=1

when querying by date, if $lt is not provided,
the empty/None/null/'' results will also be returned,
the patch aims to fix this issue by adding
$lt = datetime.now() if not provided

JIRA: RELENG-212

Change-Id: Ida1e7d386a88d4ab640441df161c1fe134593f82
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
testapi/opnfv_testapi/resources/result_handlers.py
testapi/opnfv_testapi/tests/unit/fake_pymongo.py
testapi/opnfv_testapi/tests/unit/resources/test_result.py