mirror of
https://github.com/jazzband/dj-database-url.git
synced 2026-03-16 22:20:24 +00:00
Django expects Oracle Ports as strings
This commit is contained in:
parent
c18e132b21
commit
e370c860b8
2 changed files with 8 additions and 5 deletions
|
|
@ -97,19 +97,22 @@ def parse(url, engine=None, conn_max_age=0):
|
|||
hostname = hostname.split(":", 1)[0]
|
||||
hostname = hostname.replace('%2f', '/').replace('%2F', '/')
|
||||
|
||||
# Lookup specified engine.
|
||||
engine = SCHEMES[url.scheme] if engine is None else engine
|
||||
|
||||
port = (str(url.port) if url.port and engine == SCHEMES['oracle']
|
||||
else url.port)
|
||||
|
||||
# Update with environment configuration.
|
||||
config.update({
|
||||
'NAME': urlparse.unquote(path or ''),
|
||||
'USER': urlparse.unquote(url.username or ''),
|
||||
'PASSWORD': urlparse.unquote(url.password or ''),
|
||||
'HOST': hostname,
|
||||
'PORT': url.port or '',
|
||||
'PORT': port or '',
|
||||
'CONN_MAX_AGE': conn_max_age,
|
||||
})
|
||||
|
||||
# Lookup specified engine.
|
||||
engine = SCHEMES[url.scheme] if engine is None else engine
|
||||
|
||||
# Pass the query string into OPTIONS.
|
||||
options = {}
|
||||
for key, values in query.items():
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class DatabaseTestSuite(unittest.TestCase):
|
|||
assert url['HOST'] == 'oraclehost'
|
||||
assert url['USER'] == 'scott'
|
||||
assert url['PASSWORD'] == 'tiger'
|
||||
assert url['PORT'] == 1521
|
||||
assert url['PORT'] == '1521'
|
||||
|
||||
def test_oracle_gis_parsing(self):
|
||||
url = 'oraclegis://scott:tiger@oraclehost:1521/hr'
|
||||
|
|
|
|||
Loading…
Reference in a new issue