def request_query(): query_string = str(flask.request.query_string, encoding='utf-8') return QueryString(query_string)
def test_init_query(self): query = "key1=value1&key2=한글값&key3=3" QueryString(query)
def test_unset(self): query = 'key1=a' qs = QueryString(query) qs.unset('key1') self.assertEqual(qs.get_param('key1'), None)
def test_get_array(self): query = "key1=a&key1=b" qs = QueryString(query) self.assertListEqual(qs.get_array_param('key1'), ['a', 'b'])
def test_get_int(self): query = "key1=value1&key2=한글값&key3=3" qs = QueryString(query) self.assertEqual(qs.get_int('key3'), 3)
def test_get_hangul(self): query = "key1=value1&key2=한글값&key3=3" qs = QueryString(query) self.assertEqual(qs.get_param('key2'), '한글값')