Assemble l'URL de base a partir d'elements separes, mot de passe encode
build / Garde-fou (pull_request) Successful in 18s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m42s
build / Garde-fou (push) Successful in 18s
build / Images Harbor (web, Dockerfile) (push) Successful in 13m7s
build / Garde-fou (pull_request) Successful in 18s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m42s
build / Garde-fou (push) Successful in 18s
build / Images Harbor (web, Dockerfile) (push) Successful in 13m7s
This commit is contained in:
1 parent
90609bd3d2
commit
6d02ec0c18
5 files changed
+56
-3
No files matched your search
@@ -277,3 +277,24 @@ def test_moderation_demande_la_connexion(app):
|
||||
page = app.test_client().get("/moderation")
|
||||
assert page.status_code == 200
|
||||
assert "Connexion requise".encode() in page.data
|
||||
|
||||
|
||||
def test_url_de_base_encode_les_caracteres_speciaux(monkeypatch):
|
||||
"""Un mot de passe avec @ ou : ne doit pas disloquer l'URL de connexion."""
|
||||
import importlib
|
||||
from urllib.parse import unquote, urlsplit
|
||||
|
||||
monkeypatch.delenv("ENCLUME_DATABASE_URL", raising=False)
|
||||
monkeypatch.setenv("ENCLUME_DB_HOTE", "db")
|
||||
monkeypatch.setenv("ENCLUME_DB_MOTDEPASSE", "p@ss:w0rd/#1")
|
||||
|
||||
import enclume.config
|
||||
|
||||
importlib.reload(enclume.config)
|
||||
morceaux = urlsplit(enclume.config.Config.SQLALCHEMY_DATABASE_URI)
|
||||
assert morceaux.hostname == "db"
|
||||
assert morceaux.port == 5432
|
||||
assert morceaux.username == "enclume"
|
||||
# L'URL porte la valeur encodee ; c'est le pilote qui la decode.
|
||||
assert morceaux.password == "p%40ss%3Aw0rd%2F%231"
|
||||
assert unquote(morceaux.password) == "p@ss:w0rd/#1"
|
||||
Reference in new issue
Block a user