Skip to content

Commit ed42856

Browse files
committed
test: strengthen database DSN password coverage
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
1 parent 90f9779 commit ed42856

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/unit/test_database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def test_get_database_url_normal(self, mocker, monkeypatch) -> None:
221221
mock_settings = mocker.patch("app.database.db.get_settings")
222222
mock_settings.return_value = Settings(
223223
db_user="test_user",
224-
db_password=SecretStr("test_password"),
224+
db_password=SecretStr("p@ss:word/with#chars"),
225225
db_address="test_host",
226226
db_port="5432",
227227
db_name="test_db",
@@ -231,14 +231,14 @@ def test_get_database_url_normal(self, mocker, monkeypatch) -> None:
231231
# Test normal database URL
232232
url = db.get_database_url()
233233
assert url == (
234-
"postgresql+asyncpg://test_user:test_password"
234+
"postgresql+asyncpg://test_user:p%40ss%3Aword%2Fwith%23chars"
235235
"@test_host:5432/test_db"
236236
)
237237

238238
# Test test database URL
239239
url = db.get_database_url(use_test_db=True)
240240
assert url == (
241-
"postgresql+asyncpg://test_user:test_password"
241+
"postgresql+asyncpg://test_user:p%40ss%3Aword%2Fwith%23chars"
242242
"@test_host:5432/test_db_test"
243243
)
244244

0 commit comments

Comments
 (0)