summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-12-17 15:46:40 +0000
committerGitHub <noreply@github.com>2020-12-17 10:46:40 -0500
commitc9c1c9d82f190abc2f1254f75fe42bf29eff08e1 (patch)
treedd061098c47d23c4a8066afc2931570e6760c786
parentUse the simple dictionary in full text search for the user directory (#8959) (diff)
downloadsynapse-c9c1c9d82f190abc2f1254f75fe42bf29eff08e1.tar.xz
Fix `UsersListTestCase` (#8964)
-rw-r--r--changelog.d/8964.bugfix1
-rw-r--r--tests/rest/admin/test_user.py10
2 files changed, 5 insertions, 6 deletions
diff --git a/changelog.d/8964.bugfix b/changelog.d/8964.bugfix
new file mode 100644
index 0000000000..295933d6cd
--- /dev/null
+++ b/changelog.d/8964.bugfix
@@ -0,0 +1 @@
+Fix a bug where deactivated users appeared in the user directory when their profile information was updated.
diff --git a/tests/rest/admin/test_user.py b/tests/rest/admin/test_user.py
index 9d6ef02511..9b2e4765f6 100644
--- a/tests/rest/admin/test_user.py
+++ b/tests/rest/admin/test_user.py
@@ -489,9 +489,7 @@ class UsersListTestCase(unittest.HomeserverTestCase):
         """
         other_user_token = self.login("user1", "pass1")
 
-        request, channel = self.make_request(
-            "GET", self.url, access_token=other_user_token,
-        )
+        channel = self.make_request("GET", self.url, access_token=other_user_token)
 
         self.assertEqual(403, int(channel.result["code"]), msg=channel.result["body"])
         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
             """
             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,
             )
             self.assertEqual(expected_http_code, channel.code, msg=channel.json_body)
@@ -1026,7 +1024,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
         # Deactivate user
         body = json.dumps({"deactivated": True})
 
-        request, channel = self.make_request(
+        channel = self.make_request(
             "PUT",
             self.url_other_user,
             access_token=self.admin_user_tok,
@@ -1044,7 +1042,7 @@ class UserRestTestCase(unittest.HomeserverTestCase):
         # Set new displayname user
         body = json.dumps({"displayname": "Foobar"})
 
-        request, channel = self.make_request(
+        channel = self.make_request(
             "PUT",
             self.url_other_user,
             access_token=self.admin_user_tok,