zulip/zerver
100RABHpy 21be0ef445 openapi: Refactor hacky openAPI curl test.
Fixes #17795

In PR #17014, we added support for deactivate-own-user.
And while doing so, we first deactivated the client and
then reactivated it. But this implementation is a bit
hacky.

So, to fix this, we're now deactivating a test_user so that
we don't have to reactivate it. We did so by changing the value
of authentication_line.

As we want to keep endpoint code out of the
“test_curl_examples”, we changed the value of
authentication_line in `curl_param_value_generators.py`.

To work this out, we create a new global variable named
AUTHENTICATION_LINE in “curl_param_value_generators.py”
and change its value in function “deactivate_own_user” and
to use this change in “test_curl_examples,” we import
AUTHENTICATION_LINE.

AUTHENTICATION_LINE is of list data type because we want a
pointer to original mutable object so that changes made during
run time show across the module. Another way to do this is to change
the way we import variable, but that will be inconsistent to
the way we had in all other files.

To remove confusion between AUTHENTICATION_LINE and
authentication_line we renamed authentication_line
to default_authentication_line.
2021-04-28 15:49:35 -07:00
..
data_import models/realm: Add a model for storing realm playground information. 2021-04-07 08:20:53 +05:30
integration_fixtures/nagios tests: Add a test for fixtures for non-webhook integrations. 2021-04-28 08:16:51 -07:00
lib email: Set List-Unsubscribe headers where we have unsubscribe links. 2021-04-28 15:33:32 -07:00
management send_custom_email: Improve printing of outgoing emails. 2021-04-27 21:36:17 -07:00
migrations emails: Add unsubscribe link infrastructure for marketing emails. 2021-04-27 21:36:09 -07:00
openapi openapi: Refactor hacky openAPI curl test. 2021-04-28 15:49:35 -07:00
templatetags dependencies: Upgrade to webpack-bundle-tracker 1.0.0-alpha.1. 2021-04-06 09:31:35 -07:00
tests ldap: Add advanced LDAP realm access control. 2021-04-28 09:08:13 -07:00
tornado typing: Support sending stream/topic typing status. 2021-04-27 20:52:21 -07:00
views unsubscribe: Configure as csrf_exempt. 2021-04-28 15:33:32 -07:00
webhooks integrations: Support handling batch updates for Clubhouse. 2021-04-28 08:12:47 -07:00
worker email: Open a single SMTP connection to send email batches. 2021-04-26 17:27:22 -07:00
__init__.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
apps.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00
context_processors.py i18n: Pass language name with every response. 2021-04-24 13:00:27 -07:00
decorator.py docs: Add missing space to compound verbs “log in”, “set up”, etc. 2021-04-26 09:31:08 -07:00
filters.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
forms.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00
logging_handlers.py docs: Capitalize “Markdown” consistently. 2021-04-26 09:31:08 -07:00
middleware.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00
models.py giphy: Set rating according to realm_giphy_rating. 2021-04-28 07:07:36 -07:00
signals.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00