mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
events: Add option to send partial data.
Server can now send partial data to the client to help in developement. We don't want this to be widely used right now, hence no documentation changes have been made. This will likely be a check on client capability later.
This commit is contained in:
@@ -3165,6 +3165,17 @@ class GetProfileTest(ZulipTestCase):
|
||||
result = self.client_get(f"/json/users/{user.id}")
|
||||
self.assert_json_error(result, "Insufficient permission")
|
||||
|
||||
with self.settings(PARTIAL_USERS=True), self.assert_database_query_count(9):
|
||||
result = self.client_get("/json/users")
|
||||
self.assert_json_success(result)
|
||||
|
||||
result_dict = orjson.loads(result.content)
|
||||
all_fetched_users = result_dict["members"]
|
||||
self.assertEqual(
|
||||
len(all_fetched_users),
|
||||
UserProfile.objects.filter(realm=hamlet.realm, is_bot=True).count() + 1,
|
||||
)
|
||||
|
||||
def test_get_inaccessible_user_ids(self) -> None:
|
||||
polonius = self.example_user("polonius")
|
||||
bot = self.example_user("default_bot")
|
||||
@@ -3232,6 +3243,16 @@ class GetProfileTest(ZulipTestCase):
|
||||
user_ids_to_fetch,
|
||||
)
|
||||
|
||||
with self.settings(PARTIAL_USERS=True), self.assert_database_query_count(4):
|
||||
result = self.client_get("/json/users")
|
||||
self.assert_json_success(result)
|
||||
result_dict = orjson.loads(result.content)
|
||||
all_fetched_users = result_dict["members"]
|
||||
self.assertEqual(
|
||||
len(all_fetched_users),
|
||||
UserProfile.objects.filter(realm=hamlet.realm, is_bot=True).count(),
|
||||
)
|
||||
|
||||
|
||||
class DeleteUserTest(ZulipTestCase):
|
||||
def test_do_delete_user(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user