def test_get_date_facet_counts(self):
        self._index_docs(50000,self.colls[0])
        solr = SolrClient(test_config['SOLR_SERVER'][0], devel=True, auth=test_config['SOLR_CREDENTIALS'])
        reindexer = Reindexer(source=solr, source_coll='source_coll', dest=solr, dest_coll='dest_coll', date_field='date')
        #Testing this one
        source_facet, dest_facet = reindexer._get_date_facet_counts('DAY', 'date',start_date=self._start_date.date().isoformat())
        for dt_range in source_facet:
            dt = datetime.datetime.strptime(dt_range,'%Y-%m-%dT%H:%M:%SZ').date().isoformat()
            if source_facet[dt_range] != self.date_counts[dt]:
                logging.info("{} - {} - {}".format(dt, source_facet[dt_range], self.date_counts[dt]))
            self.assertEqual(source_facet[dt_range],self.date_counts[dt])
Checks the date_range_query generation function. Makes sure the date ranges returned matches what got indexed.
dataset/ETHPy150Open moonlitesolutions/SolrClient/test/test_reindexer.py/ReindexerTests.test_get_date_facet_counts