-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for kwarg overriding engine/backend from urls
- Loading branch information
1 parent
d92e11b
commit 6abdb86
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,16 @@ def test_db_parsing(url, engine, name, host, user, passwd, port): | |
assert config['OPTIONS'] == {'reconnect': 'true'} | ||
|
||
|
||
def test_custom_db_engine(): | ||
"""Override ENGINE determined from schema.""" | ||
env_url = 'postgres://enigma:[email protected]:5431/dbname' | ||
|
||
engine = 'mypackage.backends.whatever' | ||
url = Env.db_url_config(env_url, engine=engine) | ||
|
||
assert url['ENGINE'] == engine | ||
|
||
|
||
def test_postgres_complex_db_name_parsing(): | ||
"""Make sure we can use complex postgres host.""" | ||
env_url = ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,13 @@ def test_smtp_parsing(): | |
assert url['EMAIL_PORT'] == 587 | ||
assert url['EMAIL_USE_TLS'] is True | ||
assert url['EMAIL_FILE_PATH'] == '' | ||
|
||
|
||
def test_custom_email_backend(): | ||
"""Override EMAIL_BACKEND determined from schema.""" | ||
url = 'smtps://[email protected]:[email protected]:587' | ||
|
||
backend = 'mypackage.backends.whatever' | ||
url = Env.email_url_config(url, backend=backend) | ||
|
||
assert url['EMAIL_BACKEND'] == backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters