def test_cleanup_before_run(self):
     json_output = {
         "query": {
             "filtered": {
                 "filter": {
                     "and": [{
                         "match_all": {}
                     }]
                 },
                 "query": {
                     "match_all": {}
                 }
             }
         },
         "aggs": {
             "by_day": {
                 "date_histogram": {
                     "field": "date",
                     "interval": "day",
                     "time_zone": "-01:00"
                 }
             }
         },
         "size": SIZE_LIMIT
     }
     expected_output = deepcopy(json_output)
     expected_output['size'] = 0
     query = HQESQuery('forms').date_histogram('by_day', 'date', 'day',
                                               '-01:00')
     self.checkQuery(query, json_output)
     self.checkQuery(query._clean_before_run(), expected_output)
Exemple #2
0
 def test_cleanup_before_run(self):
     json_output = {
         "query": {
             "filtered": {
                 "filter": {
                     "and": [
                         {"match_all": {}}
                     ]
                 },
                 "query": {"match_all": {}}
             }
         },
         "aggs": {
             "by_day": {
                 "date_histogram": {
                     "field": "date",
                     "interval": "day",
                     "time_zone": "-01:00"
                 }
             }
         },
         "size": SIZE_LIMIT
     }
     expected_output = deepcopy(json_output)
     expected_output['size'] = 0
     query = HQESQuery('forms').date_histogram('by_day', 'date', 'day', '-01:00')
     self.checkQuery(query, json_output)
     self.checkQuery(query._clean_before_run(), expected_output)