test_decorators: Explain typo-looking expression.

The validate_api_key sentence may look a bit confusing since we are
using webhook_bot's email address but default_bot's API key.

At first sight, and without any context on these tests, it may look like
that's just a typo, but we do want it to be like it is right now because
that way the API key used doesn't correspond to the provided email
address (triggering some untested parts of our backend logic).
This commit is contained in:
Yago González
2018-07-29 18:04:40 +02:00
committed by Tim Abbott
parent a0d8cbc9cb
commit 13b9dd33fa

View File

@@ -1069,6 +1069,9 @@ class TestValidateApiKey(ZulipTestCase):
validate_api_key(HostRequestMock(), self.webhook_bot.email, 'not_32_length')
with self.assertRaises(JsonableError):
# We use default_bot's key but webhook_bot's email address to test
# the logic when an API key is passed and it doesn't belong to the
# user whose email address has been provided.
validate_api_key(HostRequestMock(), self.webhook_bot.email, self.default_bot.api_key)
def test_validate_api_key_if_profile_is_not_active(self) -> None: