Skip to content

Commit

Permalink
Fixed logout task
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredeen committed Oct 7, 2024
1 parent 3d559c8 commit a9d9dcd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions source/tests-dev/authenticated.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ def login(self):
response.failure(f"Login as user {username} failed. Response URL does not contain /projects")

def logout(self):
logger.debug("Log out user %s", username)
# logout_data = dict(username=username, csrfmiddlewaretoken=self.csrftoken)
self.client.get("/accounts/logout/", name="---ON STOP---LOGOUT")
if self.is_authenticated:
logger.debug("Logout user %s", self.username)
logout_data = dict(username=self.username, csrfmiddlewaretoken=self.csrftoken)
with self.client.post(
"/accounts/logout/",
data=logout_data,
headers={"Referer": "foo"},
name="---ON STOP---LOGOUT",
catch_response=True,
):
pass

@task
def browse_homepage(self):
Expand Down

0 comments on commit a9d9dcd

Please sign in to comment.