File size: 621 Bytes
7cc81cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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"
    )