tests: Add test_invalid_presence().

This commit is contained in:
Steve Howell 2016-09-13 12:18:47 -07:00
parent edf7ea7f51
commit 7f94c74bf8
1 changed files with 7 additions and 0 deletions

View File

@ -1589,6 +1589,13 @@ class UserPresenceTests(ZulipTestCase):
for email, presence in json['presences'].items():
self.assertEqual(presence, {})
def test_invalid_presence(self):
# type: () -> None
email = "hamlet@zulip.com"
self.login(email)
result = self.client_post("/json/users/me/presence", {'status': 'foo'})
self.assert_json_error(result, 'Invalid presence status: foo')
def test_set_idle(self):
# type: () -> None
email = "hamlet@zulip.com"