def test_get_search(self):
with main.app.test_request_context():
# Add sample search, and attempt to get the JSON
# representing it
sid = self.add_sample_search()
rv = self.app.get("/search/{0}".format(sid))
d = json.loads(rv.data.decode("utf-8"))
# Make sure the search data is still good, and
# and only 1 search is returned
assert len(d['searches']) == 1
search = d['searches'][0]
assert search['id'] == sid
assert len(search['data_searches']) == 2
print ("test_get_search passed")
# Make sure that we can get a list of searches from the backend in
# JSON
评论列表
文章目录