<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> from django . test import TestCase <EOL> from haystack import connections , inputs <EOL> class SolrInputTestCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( SolrInputTestCase , self ) . setUp ( ) <EOL> self . query_obj = connections [ '<STR_LIT>' ] . get_query ( ) <EOL> def test_raw_init ( self ) : <EOL> raw = inputs . Raw ( '<STR_LIT>' ) <EOL> self . assertEqual ( raw . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( raw . kwargs , { } ) <EOL> self . assertEqual ( raw . post_process , False ) <EOL> raw = inputs . Raw ( '<STR_LIT>' , test = '<STR_LIT>' ) <EOL> self . assertEqual ( raw . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( raw . kwargs , { '<STR_LIT:test>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( raw . post_process , False ) <EOL> def test_raw_prepare ( self ) : <EOL> raw = inputs . Raw ( '<STR_LIT>' ) <EOL> self . assertEqual ( raw . prepare ( self . query_obj ) , '<STR_LIT>' ) <EOL> def test_clean_init ( self ) : <EOL> clean = inputs . Clean ( '<STR_LIT>' ) <EOL> self . assertEqual ( clean . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( clean . post_process , True ) <EOL> def test_clean_prepare ( self ) : <EOL> clean = inputs . Clean ( '<STR_LIT>' ) <EOL> self . assertEqual ( clean . prepare ( self . query_obj ) , '<STR_LIT>' ) <EOL> def test_exact_init ( self ) : <EOL> exact = inputs . Exact ( '<STR_LIT>' ) <EOL> self . assertEqual ( exact . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( exact . post_process , True ) <EOL> def test_exact_prepare ( self ) : <EOL> exact = inputs . Exact ( '<STR_LIT>' ) <EOL> self . assertEqual ( exact . prepare ( self . query_obj ) , u'<STR_LIT>' ) <EOL> exact = inputs . Exact ( '<STR_LIT>' , clean = True ) <EOL> self . assertEqual ( exact . prepare ( self . query_obj ) , u'<STR_LIT>' ) <EOL> def test_not_init ( self ) : <EOL> not_it = inputs . Not ( '<STR_LIT>' ) <EOL> self . assertEqual ( not_it . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( not_it . post_process , True ) <EOL> def test_not_prepare ( self ) : <EOL> not_it = inputs . Not ( '<STR_LIT>' ) <EOL> self . assertEqual ( not_it . prepare ( self . query_obj ) , u'<STR_LIT>' ) <EOL> def test_autoquery_init ( self ) : <EOL> autoquery = inputs . AutoQuery ( '<STR_LIT>' ) <EOL> self . assertEqual ( autoquery . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( autoquery . post_process , False ) <EOL> def test_autoquery_prepare ( self ) : <EOL> autoquery = inputs . AutoQuery ( '<STR_LIT>' ) <EOL> self . assertEqual ( autoquery . prepare ( self . query_obj ) , u'<STR_LIT>' ) <EOL> def test_altparser_init ( self ) : <EOL> altparser = inputs . AltParser ( '<STR_LIT>' ) <EOL> self . assertEqual ( altparser . parser_name , '<STR_LIT>' ) <EOL> self . assertEqual ( altparser . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( altparser . kwargs , { } ) <EOL> self . assertEqual ( altparser . post_process , False ) <EOL> altparser = inputs . AltParser ( '<STR_LIT>' , '<STR_LIT>' , qf = '<STR_LIT>' , mm = <NUM_LIT:1> ) <EOL> self . assertEqual ( altparser . parser_name , '<STR_LIT>' ) <EOL> self . assertEqual ( altparser . query_string , '<STR_LIT>' ) <EOL> self . assertEqual ( altparser . kwargs , { '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertEqual ( altparser . post_process , False ) <EOL> def test_altparser_prepare ( self ) : <EOL> altparser = inputs . AltParser ( '<STR_LIT>' , '<STR_LIT>' , qf = '<STR_LIT>' , mm = <NUM_LIT:1> ) <EOL> self . assertEqual ( altparser . prepare ( self . query_obj ) , <EOL> u"""<STR_LIT>""" ) <EOL> altparser = inputs . AltParser ( '<STR_LIT>' , '<STR_LIT>' , qf = '<STR_LIT>' , mm = <NUM_LIT:1> ) <EOL> self . assertEqual ( altparser . prepare ( self . query_obj ) , <EOL> u"""<STR_LIT>""" ) </s>
