tests/e2e: fix ldap tests following #10270 (#10288) Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
![98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
6c159d120b
commit
cd581efacd
@ -5,7 +5,6 @@ from time import sleep
|
||||
|
||||
from docker.client import DockerClient, from_env
|
||||
from docker.models.containers import Container
|
||||
from guardian.shortcuts import get_anonymous_user
|
||||
from ldap3 import ALL, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, SUBTREE, Connection, Server
|
||||
from ldap3.core.exceptions import LDAPInvalidCredentialsResult
|
||||
|
||||
@ -180,15 +179,13 @@ class TestProviderLDAP(SeleniumTestCase):
|
||||
)
|
||||
with self.assertRaises(LDAPInvalidCredentialsResult):
|
||||
_connection.bind()
|
||||
anon = get_anonymous_user()
|
||||
self.assertTrue(
|
||||
Event.objects.filter(
|
||||
action=EventAction.LOGIN_FAILED,
|
||||
user={
|
||||
"pk": anon.pk,
|
||||
"email": anon.email,
|
||||
"username": anon.username,
|
||||
"is_anonymous": True,
|
||||
"pk": self.user.pk,
|
||||
"email": self.user.email,
|
||||
"username": self.user.username,
|
||||
},
|
||||
).exists(),
|
||||
)
|
||||
|
Reference in New Issue
Block a user