diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-24 18:11:37 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-24 18:11:37 -0500 |
commit | 2800e34710672b408fa4a7bdd6d58d63a7128f04 (patch) | |
tree | a2108d949abe6cc97b8766b4b73022be30bb3318 /test/engine/test_parseconnect.py | |
parent | 579f09974b4813f35fe0c701bbf678d5eccc4aeb (diff) | |
download | sqlalchemy-2800e34710672b408fa4a7bdd6d58d63a7128f04.tar.gz |
- The :func:`.create_engine` routine and the related
:func:`.make_url` function **no longer URL encode the password**.
Database passwords that include characters like spaces, plus signs
and anything else should now represent these characters directly,
without any URL escaping. [ticket:2873]
Diffstat (limited to 'test/engine/test_parseconnect.py')
-rw-r--r-- | test/engine/test_parseconnect.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/engine/test_parseconnect.py b/test/engine/test_parseconnect.py index 07ce96d5e..d1ffe426d 100644 --- a/test/engine/test_parseconnect.py +++ b/test/engine/test_parseconnect.py @@ -31,7 +31,7 @@ class ParseConnectTest(fixtures.TestBase): 'dbtype://', 'dbtype://username:password@/database', 'dbtype:////usr/local/_xtest@example.com/members.db', - 'dbtype://username:apples%2Foranges@hostspec/database', + 'dbtype://username:apples/oranges@hostspec/database', 'dbtype://username:password@[2001:da8:2004:1000:202:116:160:90]/database?foo=bar', 'dbtype://username:password@[2001:da8:2004:1000:202:116:160:90]:80/database?foo=bar' ): @@ -49,6 +49,28 @@ class ParseConnectTest(fixtures.TestBase): 'E:/work/src/LEM/db/hello.db', None), u.database eq_(str(u), text) + def test_rfc1738_password(self): + u = url.make_url("dbtype://user:pass word + other:words@host/dbname") + eq_(u.password, "pass word + other:words") + eq_(str(u), "dbtype://user:pass word + other:words@host/dbname") + + u = url.make_url('dbtype://username:apples%2Foranges@hostspec/database') + eq_(u.password, "apples%2Foranges") + eq_(str(u), 'dbtype://username:apples%2Foranges@hostspec/database') + + u = url.make_url('dbtype://username:apples@oranges@@@hostspec/database') + eq_(u.password, "apples@oranges@@") + eq_(str(u), 'dbtype://username:apples@oranges@@@hostspec/database') + + u = url.make_url('dbtype://username@:@hostspec/database') + eq_(u.password, '') + eq_(u.username, "username@") + eq_(str(u), 'dbtype://username@:@hostspec/database') + + u = url.make_url('dbtype://username:pass/word@hostspec/database') + eq_(u.password, 'pass/word') + eq_(str(u), 'dbtype://username:pass/word@hostspec/database') + class DialectImportTest(fixtures.TestBase): def test_import_base_dialects(self): |