api: Refactor get_members_backend to return a single bot's data.

This makes `get_members_backend` in zerver/views/users.py to
return a single bot's data too.
This commit is contained in:
Kartik Srivastava
2020-04-22 02:15:58 +05:30
committed by GitHub
parent 87fdef2472
commit b29ccdf51c
2 changed files with 6 additions and 1 deletions

View File

@@ -1415,6 +1415,11 @@ class GetProfileTest(ZulipTestCase):
result = self.client_get('/json/users/{}?'.format(30))
self.assert_json_error(result, "No such user")
bot = self.example_user("default_bot")
result = ujson.loads(self.client_get('/json/users/{}'.format(bot.id)).content)
self.assertEqual(result['user']['email'], bot.email)
self.assertTrue(result['user']['is_bot'])
def test_api_get_empty_profile(self) -> None:
"""
Ensure GET /users/me returns a max message id and returns successfully