You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"id": "firstdate",
"date_entered": "2018-12-12",
"text4": "This is a test of the national broadcasting system"
},
{
"id": "seconddate",
"date_entered": "2019-04-04",
"text5": "Who are the britons?"
}
Unittest
def test_search_query_date_less_than(self):
"""
Test query less than a certain date
"""
response = self.app.post(
'/python/search/search',
json={"index": "index-1", "query": "date_entered < 2019-04-04"})
self.assertEquals(response.status_code, 200)
self.assertIn('documents', response.json())
documents = response.json()['documents']
# Should only be one document
self.assertEquals(len(documents), 1)
doc = documents[0]
# Make sure we got the right document back with that date.
self.assertEquals(doc['date_entered'], '2018-12-12')
self.assertEquals(doc['text4'], "This is a test of the national broadcasting system")
I have two documents with dates:
Unittest
Expected
One document, with date_entered: 2018
Actual
One document, with date_entered: 2019
Search logs
The text was updated successfully, but these errors were encountered: