mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
api docs: Add page for common error payloads.
We now have a separate page for common error payloads, for example, the payload for when the client's API key is invalid. All error payloads that are presented on this page will be tested similarly to our other non-error sample fixtures.
This commit is contained in:
@@ -14,7 +14,7 @@ os.chdir(ZULIP_PATH)
|
||||
from zulip import Client
|
||||
|
||||
from tools.lib.test_server import test_server_running
|
||||
from zerver.lib.api_test_helpers import test_the_api
|
||||
from zerver.lib.api_test_helpers import test_the_api, test_invalid_api_key
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
|
||||
django.setup()
|
||||
@@ -35,4 +35,13 @@ with test_server_running(external_host='zulipdev.com:9981'):
|
||||
print("Running API tests...")
|
||||
test_the_api(client)
|
||||
|
||||
# Test error payloads
|
||||
client = Client(
|
||||
email=email,
|
||||
api_key='abcedrsdfd',
|
||||
site=site
|
||||
)
|
||||
test_invalid_api_key(client)
|
||||
|
||||
|
||||
print("API tests passed!")
|
||||
|
Reference in New Issue
Block a user