#NEWLINE# def test_get_date_range_query( self ) : #NEWLINE# #INDENT# "\n        Checks the date_range_query generation function. Since it's pretty simple, running all the tests as one\n        " #NEWLINE# solr = SolrClient ( test_config [ 'SOLR_SERVER' ] [ 0 ] , devel = True , auth = test_config [ 'SOLR_CREDENTIALS' ] ) #NEWLINE# reindexer = Reindexer ( source = reindexer , source_coll = 'source_coll' , dest = solr , dest_coll = 'dest_coll' , date_field = 'index_date' ) #NEWLINE# self . assertEqual ( reindexer . _get_date_range_query ( '2015-11-10' , '2015-12-11' ) , { #NEWLINE# #INDENT# 'rows' : 0 , #NEWLINE# 'facet.range.end' : '2015-12-11' , #NEWLINE# 'facet' : 'true' , #NEWLINE# 'facet.range' : 'index_date' , #NEWLINE# 'facet.range.start' : '2015-11-10' , #NEWLINE# 'q' : '*:*' , #NEWLINE# 'facet.range.include' : 'all' , #NEWLINE# 'facet.range.gap' : '+1DAY' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( reindexer . _get_date_range_query ( '2015-11-10' , '2015-12-11' , date_field = 'date123' ) , { #NEWLINE# #INDENT# 'rows' : 0 , #NEWLINE# 'facet.range.end' : '2015-12-11' , #NEWLINE# 'facet' : 'true' , #NEWLINE# 'facet.range' : 'date123' , #NEWLINE# 'facet.range.start' : '2015-11-10' , #NEWLINE# 'q' : '*:*' , #NEWLINE# 'facet.range.include' : 'all' , #NEWLINE# 'facet.range.gap' : '+1DAY' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( reindexer . _get_date_range_query ( '2015-11-10' , '2015-12-11' , date_field = 'date123' , timespan = 'MONTH' ) , { #NEWLINE# #INDENT# 'rows' : 0 , #NEWLINE# 'facet.range.end' : '2015-12-11' , #NEWLINE# 'facet' : 'true' , #NEWLINE# 'facet.range' : 'date123' , #NEWLINE# 'facet.range.start' : '2015-11-10' , #NEWLINE# 'q' : '*:*' , #NEWLINE# 'facet.range.include' : 'all' , #NEWLINE# 'facet.range.gap' : '+1MONTH' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( reindexer . _get_date_range_query ( '2015-11-10' , '2015-12-11' , timespan = 'MONTH' ) , { #NEWLINE# #INDENT# 'rows' : 0 , #NEWLINE# 'facet.range.end' : '2015-12-11' , #NEWLINE# 'facet' : 'true' , #NEWLINE# 'facet.range' : 'index_date' , #NEWLINE# 'facet.range.start' : '2015-11-10' , #NEWLINE# 'q' : '*:*' , #NEWLINE# 'facet.range.include' : 'all' , #NEWLINE# 'facet.range.gap' : '+1MONTH' , #NEWLINE# #UNINDENT# } )