def test_parse_query_terms_after_phrase(self): parsed = parse_query_string('"electronic filing" 2016') assert parsed == dict(terms=['2016'], phrases=['electronic filing'])
def test_parse_query_with_only_phrase(self): parsed = parse_query_string('"electronic filing"') assert parsed == dict(terms=[], phrases=['electronic filing'])
def test_parse_query_with_phrase(self): parsed = parse_query_string('require "electronic filing" 2016') assert parsed == dict(terms=['require', '2016'], phrases=['electronic filing'])
def test_parse_query_with_many_phrases(self): parsed = parse_query_string( 'require "electronic filing" 2016 "sans computer"') assert parsed == dict(terms=['require', '2016'], phrases=['electronic filing', 'sans computer'])
def test_parse_query_no_phrase(self): parsed = parse_query_string('hello world') assert parsed == dict(terms=['hello world'], phrases=[])