def test_q_is_set_but_is_empty_should_return_true(self): request = construct_dummy_request(params={'q': ''}) response = valid_q_parameter(request) self.assertFalse(response)
def test_q_is_set_but_is_not_escaped_should_return_true(self): request = construct_dummy_request(params={'q': '<foo'}) response = valid_q_parameter(request) self.assertTrue(response)
def test_q_is_missing_should_return_false(self): request = construct_dummy_request(params={}) response = valid_q_parameter(request) self.assertFalse(response)