def test_dfq_returns_default_if_passed_on_error(self): assert decode_from_querystring('abcd', default='error') == 'error'
def test_dfq_doesnt_accept_bytes(self): with self.assertRaises(TypeError): decode_from_querystring(b'VGhlRW50ZXI_cHJpc2U~')
def test_dfq_raises_response_on_error(self): with self.assertRaises(Response) as cm: decode_from_querystring('abcd') assert cm.exception.code == 400
def test_dfq_decodes_properly(self): assert decode_from_querystring('VGhlRW50ZXI_cHJpc2U~') == 'TheEnter?prise' assert decode_from_querystring('VGhlRW50ZXJwcmlzZQ~~') == 'TheEnterprise'