def test_get_date_range_query(self):
        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='index_date')
        self.assertEqual(
            reindexer._get_date_range_query('2015-11-10', '2015-12-11'),
            {'rows': 0, 'facet.range.end': '2015-12-11', 'facet': 'true', 'facet.range': 'index_date', 
            'facet.range.start': '2015-11-10', 'q': '*:*', 'facet.range.include': 'all', 'facet.range.gap': '+1DAY'}
            )
        self.assertEqual(
            reindexer._get_date_range_query('2015-11-10', '2015-12-11', date_field = 'date123'),
            {'rows': 0, 'facet.range.end': '2015-12-11', 'facet': 'true', 'facet.range': 'date123', 
            'facet.range.start': '2015-11-10', 'q': '*:*', 'facet.range.include': 'all', 'facet.range.gap': '+1DAY'}
            )
        self.assertEqual(
            reindexer._get_date_range_query('2015-11-10', '2015-12-11', date_field = 'date123', timespan='MONTH'),
            {'rows': 0, 'facet.range.end': '2015-12-11', 'facet': 'true', 'facet.range': 'date123', 
            'facet.range.start': '2015-11-10', 'q': '*:*', 'facet.range.include': 'all', 'facet.range.gap': '+1MONTH'}
            )
        self.assertEqual(
            reindexer._get_date_range_query('2015-11-10', '2015-12-11', timespan='MONTH'),
            {'rows': 0, 'facet.range.end': '2015-12-11', 'facet': 'true', 'facet.range': 'index_date', 
            'facet.range.start': '2015-11-10', 'q': '*:*', 'facet.range.include': 'all', 'facet.range.gap': '+1MONTH'}
            )
Show only published posts outside debug.
dataset/ETHPy150Open moonlitesolutions/SolrClient/test/test_reindexer.py/ReindexerTests.test_get_date_range_query--crossover with--dataset/ETHPy150Open marteinn/AtomicPress/atomicpress/themes/minimal/helpers.py/gen_post_status