0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-15 14:32:30 +01:00

Fix UsersListTestCase (#8964)

This commit is contained in:
Richard van der Hoff 2020-12-17 15:46:40 +00:00 committed by GitHub
parent f2783fc201
commit c9c1c9d82f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

1
changelog.d/8964.bugfix Normal file
View file

@ -0,0 +1 @@
Fix a bug where deactivated users appeared in the user directory when their profile information was updated.

View file

@ -489,9 +489,7 @@ class UsersListTestCase(unittest.HomeserverTestCase):
""" """
other_user_token = self.login("user1", "pass1") other_user_token = self.login("user1", "pass1")
request, channel = self.make_request( channel = self.make_request("GET", self.url, access_token=other_user_token)
"GET", self.url, access_token=other_user_token,
)
self.assertEqual(403, int(channel.result["code"]), msg=channel.result["body"]) self.assertEqual(403, int(channel.result["code"]), msg=channel.result["body"])
self.assertEqual(Codes.FORBIDDEN, channel.json_body["errcode"]) self.assertEqual(Codes.FORBIDDEN, channel.json_body["errcode"])
@ -540,7 +538,7 @@ class UsersListTestCase(unittest.HomeserverTestCase):
expected_http_code: The expected http code for the request expected_http_code: The expected http code for the request
""" """
url = self.url + "?%s=%s" % (search_field, search_term,) url = self.url + "?%s=%s" % (search_field, search_term,)
request, channel = self.make_request( channel = self.make_request(
"GET", url.encode("ascii"), access_token=self.admin_user_tok, "GET", url.encode("ascii"), access_token=self.admin_user_tok,
) )
self.assertEqual(expected_http_code, channel.code, msg=channel.json_body) self.assertEqual(expected_http_code, channel.code, msg=channel.json_body)
@ -1026,7 +1024,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
# Deactivate user # Deactivate user
body = json.dumps({"deactivated": True}) body = json.dumps({"deactivated": True})
request, channel = self.make_request( channel = self.make_request(
"PUT", "PUT",
self.url_other_user, self.url_other_user,
access_token=self.admin_user_tok, access_token=self.admin_user_tok,
@ -1044,7 +1042,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
# Set new displayname user # Set new displayname user
body = json.dumps({"displayname": "Foobar"}) body = json.dumps({"displayname": "Foobar"})
request, channel = self.make_request( channel = self.make_request(
"PUT", "PUT",
self.url_other_user, self.url_other_user,
access_token=self.admin_user_tok, access_token=self.admin_user_tok,