push_notifications: Provide a hint when the server is not registered.

This commit is contained in:
Alex Vandiver 2021-10-18 18:30:05 -07:00 committed by Tim Abbott
parent 1c1a1e2cad
commit cbbd4b128d
2 changed files with 5 additions and 3 deletions

View File

@ -211,7 +211,7 @@ class InvalidZulipServerError(JsonableError):
@staticmethod
def msg_format() -> str:
return "Zulip server auth failure: {role} is not registered"
return "Zulip server auth failure: {role} is not registered -- did you run `manage.py register_server`?"
class InvalidZulipServerKeyError(InvalidZulipServerError):

View File

@ -247,7 +247,9 @@ class PushBouncerNotificationTest(BouncerTestCase):
HTTP_AUTHORIZATION=api_auth,
)
self.assert_json_error(
result, "Zulip server auth failure: 5678-efgh is not registered", status_code=401
result,
"Zulip server auth failure: 5678-efgh is not registered -- did you run `manage.py register_server`?",
status_code=401,
)
def test_remote_push_user_endpoints(self) -> None:
@ -1981,7 +1983,7 @@ class TestSendToPushBouncer(ZulipTestCase):
self.assertEqual(
str(exc.exception),
"Push notifications bouncer error: "
"Zulip server auth failure: testRole is not registered",
"Zulip server auth failure: testRole is not registered -- did you run `manage.py register_server`?",
)
@responses.activate