MediaRouter / tests /test_database_url.py
basyx's picture
Upload 437 files
7cc81cb verified
Raw
History Blame Contribute Delete
621 Bytes
from app.core.database_url import normalize_async_database_url
def test_bare_postgres_urls_use_the_installed_async_driver() -> None:
assert (
normalize_async_database_url("postgresql://user:secret@db.example/app")
== "postgresql+asyncpg://user:secret@db.example/app"
)
assert (
normalize_async_database_url("postgres://user:secret@db.example/app")
== "postgresql+asyncpg://user:secret@db.example/app"
)
assert (
normalize_async_database_url("postgresql+asyncpg://user:secret@db.example/app")
== "postgresql+asyncpg://user:secret@db.example/app"
)