Skip to content

Commit bd7fbd9

Browse files
committed
test: modify login test to approve dex confirmation page
1 parent 6ac8ff5 commit bd7fbd9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

diracx-testing/src/diracx/testing/__init__.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from html.parser import HTMLParser
1010
from pathlib import Path
1111
from typing import TYPE_CHECKING
12-
from urllib.parse import urljoin
12+
from urllib.parse import parse_qs, urljoin, urlparse
1313
from uuid import uuid4
1414

1515
import pytest
@@ -551,5 +551,13 @@ def handle_starttag(self, tag, attrs):
551551
verify=ca_path,
552552
)
553553
r.raise_for_status()
554+
approval_url = r.url # This is not the same as URL as we redirect to dex
555+
# Do the actual approval
556+
r = requests.post(
557+
approval_url,
558+
{"approval": "approve", "req": parse_qs(urlparse(r.url).query)["req"][0]},
559+
verify=ca_path,
560+
)
561+
554562
# This should have redirected to the DiracX page that shows the login is complete
555563
assert "Please close the window" in r.text

0 commit comments

Comments
 (0)