Skip to content

Commit

Permalink
fix test and config default params
Browse files Browse the repository at this point in the history
  • Loading branch information
Brodan committed Dec 12, 2022
1 parent 9740c13 commit a36ecda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dj_database_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ def config(
default=None,
engine=None,
conn_max_age=0,
conn_health_checks=False,
ssl_require=False,
test_options={},
):
"""Returns configured DATABASE dictionary from DATABASE_URL."""
s = os.environ.get(env, default)

if s:
return parse(s, engine, conn_max_age, ssl_require, test_options)
return parse(s, engine, conn_max_age, conn_health_checks, ssl_require, test_options)

return {}

Expand Down Expand Up @@ -131,7 +132,7 @@ def parse(
}
)
if test_options:
config.update(
parsed_config.update(
{
'TEST': test_options,
}
Expand Down
3 changes: 3 additions & 0 deletions test_dj_database_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ def test_mysql_connector_parsing(self):
assert url["PORT"] == 5431

def test_config_test_options(self):
os.environ[
"DATABASE_URL"
] = "postgres://uf07k1i6d8ia0v:wegauwhgeuioweg@ec2-107-21-253-135.compute-1.amazonaws.com:5431/d8r82722r2kuvn?"
test_db_config = {
'NAME': 'mytestdatabase',
}
Expand Down

0 comments on commit a36ecda

Please sign in to comment.