summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2023-04-21 22:26:11 +0200
committerFederico Caselli <cfederico87@gmail.com>2023-04-25 18:52:08 +0200
commit040e0d2560c17ff490b2b0bbe193c7658d3b4603 (patch)
tree6d2be95d442d8d56588a91d65446a4a291b8e9ad /test
parente8173073ffd4b08a6efd36b7d290642ae96f5de3 (diff)
downloadsqlalchemy-040e0d2560c17ff490b2b0bbe193c7658d3b4603.tar.gz
Fixed bug in `URL.normalized_query`
Fixed a bug that prevented use of :attr:`_engine.URL.normalized_query` in SQLAlchemy v2. Fixes: #9682 Change-Id: I2704154af34f438b4cbb290602fc936c1184c074
Diffstat (limited to 'test')
-rw-r--r--test/engine/test_parseconnect.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/engine/test_parseconnect.py b/test/engine/test_parseconnect.py
index 471201666..65cf6b5f1 100644
--- a/test/engine/test_parseconnect.py
+++ b/test/engine/test_parseconnect.py
@@ -179,6 +179,7 @@ class URLTest(fixtures.TestBase):
def test_query_string(self):
u = url.make_url("dialect://user:pass@host/db?arg1=param1&arg2=param2")
eq_(u.query, {"arg1": "param1", "arg2": "param2"})
+ eq_(u.normalized_query, {"arg1": ("param1",), "arg2": ("param2",)})
eq_(
u.render_as_string(hide_password=False),
"dialect://user:pass@host/db?arg1=param1&arg2=param2",
@@ -215,6 +216,10 @@ class URLTest(fixtures.TestBase):
)
eq_(u.query, {"arg1": "param1", "arg2": ("param2", "param3")})
eq_(
+ u.normalized_query,
+ {"arg1": ("param1",), "arg2": ("param2", "param3")},
+ )
+ eq_(
u.render_as_string(hide_password=False),
"dialect://user:pass@host/db?arg1=param1&arg2=param2&arg2=param3",
)
@@ -222,6 +227,7 @@ class URLTest(fixtures.TestBase):
test_url = "dialect://user:pass@host/db?arg1%3D=param1&arg2=param+2"
u = url.make_url(test_url)
eq_(u.query, {"arg1=": "param1", "arg2": "param 2"})
+ eq_(u.normalized_query, {"arg1=": ("param1",), "arg2": ("param 2",)})
eq_(u.render_as_string(hide_password=False), test_url)
def test_comparison(self):