From 29b7368f42213a717b59c1c11808fab9c3b27691 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 23 Nov 2021 23:56:23 +0100 Subject: [PATCH] tests/e2e: fix static user checks Signed-off-by: Jens Langhammer --- tests/e2e/test_provider_proxy.py | 4 +--- tests/e2e/test_source_saml.py | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/test_provider_proxy.py b/tests/e2e/test_provider_proxy.py index fcfaee10b..d5b67db2c 100644 --- a/tests/e2e/test_provider_proxy.py +++ b/tests/e2e/test_provider_proxy.py @@ -82,7 +82,6 @@ class TestProviderProxy(SeleniumTestCase): type=OutpostType.PROXY, ) outpost.providers.add(proxy) - outpost.save() outpost.build_user_permissions(outpost.user) self.proxy_container = self.start_proxy(outpost) @@ -102,7 +101,7 @@ class TestProviderProxy(SeleniumTestCase): sleep(1) full_body_text = self.driver.find_element(By.CSS_SELECTOR, "pre").text - self.assertIn("X-Forwarded-Preferred-Username: akadmin", full_body_text) + self.assertIn(f"X-authentik-username: {self.user.username}", full_body_text) self.assertIn("X-Foo: bar", full_body_text) self.driver.get("http://localhost:9000/akprox/sign_out") @@ -145,7 +144,6 @@ class TestProviderProxyConnect(ChannelsLiveServerTestCase): _config=asdict(OutpostConfig(authentik_host=self.live_server_url, log_level="debug")), ) outpost.providers.add(proxy) - outpost.save() outpost.build_user_permissions(outpost.user) # Wait until outpost healthcheck succeeds diff --git a/tests/e2e/test_source_saml.py b/tests/e2e/test_source_saml.py index 8ad1cf496..b53005850 100644 --- a/tests/e2e/test_source_saml.py +++ b/tests/e2e/test_source_saml.py @@ -156,6 +156,7 @@ class TestSourceSAML(SeleniumTestCase): User.objects.exclude(username="akadmin") .exclude(username__startswith="ak-outpost") .exclude(pk=get_anonymous_user().pk) + .exclude(pk=self.user.pks) .first() ) @@ -235,6 +236,7 @@ class TestSourceSAML(SeleniumTestCase): User.objects.exclude(username="akadmin") .exclude(username__startswith="ak-outpost") .exclude(pk=get_anonymous_user().pk) + .exclude(pk=self.user.pks) .first() ) @@ -301,5 +303,6 @@ class TestSourceSAML(SeleniumTestCase): User.objects.exclude(username="akadmin") .exclude(username__startswith="ak-outpost") .exclude(pk=get_anonymous_user().pk) + .exclude(pk=self.user.pks) .first() )