Skip to content

Commit

Permalink
tests/e2e: fix ldap tests following #10270 (#10288)
Browse files Browse the repository at this point in the history
  • Loading branch information
rissson authored Jun 28, 2024
1 parent ca960f3 commit 8915904
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/e2e/test_provider_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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

Expand Down Expand Up @@ -180,15 +179,13 @@ def test_ldap_bind_fail(self):
)
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(),
)
Expand Down

0 comments on commit 8915904

Please sign in to comment.