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