Пример #1
0
 def test_dfq_returns_default_if_passed_on_error(self):
     assert decode_from_querystring('abcd', default='error') == 'error'
Пример #2
0
 def test_dfq_doesnt_accept_bytes(self):
     with self.assertRaises(TypeError):
         decode_from_querystring(b'VGhlRW50ZXI_cHJpc2U~')
Пример #3
0
 def test_dfq_raises_response_on_error(self):
     with self.assertRaises(Response) as cm:
         decode_from_querystring('abcd')
     assert cm.exception.code == 400
Пример #4
0
 def test_dfq_decodes_properly(self):
     assert decode_from_querystring('VGhlRW50ZXI_cHJpc2U~') == 'TheEnter?prise'
     assert decode_from_querystring('VGhlRW50ZXJwcmlzZQ~~') == 'TheEnterprise'
Пример #5
0
 def test_dfq_returns_default_if_passed_on_error(self):
     assert decode_from_querystring('abcd', default='error') == 'error'
Пример #6
0
 def test_dfq_raises_response_on_error(self):
     with self.assertRaises(Response) as cm:
         decode_from_querystring('abcd')
     assert cm.exception.code == 400
Пример #7
0
 def test_dfq_doesnt_accept_bytes(self):
     with self.assertRaises(TypeError):
         decode_from_querystring(b'VGhlRW50ZXI_cHJpc2U~')
Пример #8
0
 def test_dfq_decodes_properly(self):
     assert decode_from_querystring('VGhlRW50ZXI_cHJpc2U~') == 'TheEnter?prise'
     assert decode_from_querystring('VGhlRW50ZXJwcmlzZQ~~') == 'TheEnterprise'