zulip/zerver/tests
Alex Vandiver f00ff1ef62 middleware: Make HostDomain into a process_request, not process_response.
It is more suited for `process_request`, since it should stop
execution of the request if the domain is invalid.  This code was
likely added as a process_response (in ea39fb2556) because there was
already a process_response at the time (added 7e786d5426, and no
longer necessary since dce6b4a40f).

It quiets an unnecessary warning when logging in at a non-existent
realm.

This stops performing unnecessary work when we are going to throw it
away and return a 404.  The edge case to this is if the request
_creates_ a realm, and is made using the URL of the new realm; this
change would prevent the request before it occurs. While this does
arise in tests, the tests do not reflect reality -- real requests to
/accounts/register/ are made via POST to the same (default) realm,
redirected there from `confirm-preregistrationuser`.  The tests are
adjusted to reflect real behavior.

Tweaked by tabbott to add a block comment in HostDomainMiddleware.
2020-08-11 10:37:55 -07:00
..
fixtures docs: Fix spelling errors caught by codespell. 2020-08-11 10:23:06 -07:00
images
__init__.py
test_alert_words.py populate_db: Add alert words for Zulip users. 2020-07-15 12:33:08 -07:00
test_archive.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_attachments.py models: Change attachment.size to not be nullable. 2020-06-20 13:15:02 -07:00
test_audit_log.py realm_audit_log: Fix malformed RealmAuditLog entries. 2020-08-09 16:51:29 -07:00
test_auth_backends.py docs: Correct “login” as a verb to “log in”. 2020-08-11 10:25:53 -07:00
test_bots.py event_queue: Convert users argument of send_event to list. 2020-08-07 11:12:32 -07:00
test_cache.py test_cache: Use assertLogs to avoid spam in test-backend output. 2020-07-26 16:14:17 -07:00
test_camo.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_compatibility.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_create_video_call.py calls: Add Big Blue Button as a Video Call Provider. 2020-06-22 16:19:07 -07:00
test_custom_profile_data.py test_custom_profile_data: Convert order QuerySet to list. 2020-08-07 10:53:06 -07:00
test_decorators.py logging: Report stack_info on logging.exception calls. 2020-08-11 10:16:54 -07:00
test_digest.py Revert "digest: Support digest of web public streams for guest users." 2020-07-29 21:05:59 -07:00
test_docs.py billing: Don't allow guest users to upgrade. 2020-07-22 16:57:49 -07:00
test_drafts.py drafts: Add an API endpoint for fetching drafts. 2020-07-28 17:18:35 -07:00
test_email_change.py emails: Add a custom header specifying the organization when possible. 2020-06-28 13:33:02 -07:00
test_email_log.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_email_mirror.py email_mirror: Fix exception handling unstructured headers. 2020-07-22 12:11:25 -07:00
test_email_notifications.py auth: Remove short_name from LDAP API. 2020-07-17 11:28:08 -07:00
test_embedded_bot_system.py test_embedded_bot_system: Replace type: ignore annotations with an assert. 2020-06-23 11:29:54 -07:00
test_event_queue.py pointer tests: Use restart for test_collapse_event. 2020-06-26 10:02:37 -07:00
test_event_system.py actions: Remove log_event and its legacy settings. 2020-07-24 12:13:16 -07:00
test_events.py realm_audit_log: Fix malformed RealmAuditLog entries. 2020-08-09 16:51:29 -07:00
test_external.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_gitter_importer.py tests: Avoid "import logging" and setting root logger level in tests. 2020-07-26 16:14:17 -07:00
test_hipchat_importer.py test_hipchat_importer: Fix a type: ignore issue. 2020-06-30 18:58:23 -07:00
test_home.py test_home: Use assertLogs to test info logs by do_soft_deactivate_users. 2020-07-26 16:14:17 -07:00
test_hotspots.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
test_i18n.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_import_export.py audit_log: Record RealmAuditLog in do_change_icon_source. 2020-07-24 11:56:40 -07:00
test_integrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_integrations_dev_panel.py docs: Fix spelling errors caught by codespell. 2020-08-11 10:23:06 -07:00
test_internet.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_legacy_subject.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_link_embed.py test_link_embed: Add assertLogs to prevent spam in test-backend. 2020-07-26 16:14:17 -07:00
test_logging_handlers.py Error reporting emails: Indicate user role. 2020-08-03 13:35:51 -07:00
test_management_commands.py test_management_commands: Fix export test. 2020-07-30 13:26:06 -07:00
test_markdown.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_mattermost_importer.py tests: Avoid "import logging" for importer tests. 2020-07-24 10:45:59 -07:00
test_message_dict.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_message_edit.py tests: Move DeleteMessageTest class to test_message_edit.py. 2020-07-06 16:36:36 -07:00
test_message_edit_notifications.py push_notifications: Disable badge counts. 2020-07-15 22:19:53 -07:00
test_message_fetch.py api: Remove (sender_)short_name from message APIs. 2020-07-17 11:15:14 -07:00
test_message_flags.py tests: Verify info logs logging in test_fix_unreads. 2020-07-21 12:22:21 -07:00
test_message_send.py logging: Report stack_info on logging.exception calls. 2020-08-11 10:16:54 -07:00
test_message_topics.py tests: Extract test_message_topics.py for topic tests. 2020-07-06 16:36:36 -07:00
test_messages.py tests: Move test_near_pm_message_url to test_message_fetch.py. 2020-07-08 14:00:05 -07:00
test_middleware.py refactor: Rename bugdown words to markdown in stats related functions. 2020-06-26 17:20:40 -07:00
test_migrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_mirror_users.py tests: Move test_create_mirror_user_despite_race to test_mirror_users.py. 2020-07-06 16:36:36 -07:00
test_muting.py mypy: Use tuples for muted_topics. 2020-06-24 15:01:57 -07:00
test_new_users.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_onboarding.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_openapi.py docs: Fix spelling errors caught by codespell. 2020-08-11 10:23:06 -07:00
test_outgoing_webhook_interfaces.py api: Remove (sender_)short_name from message APIs. 2020-07-17 11:15:14 -07:00
test_outgoing_webhook_system.py outgoing webhook tests: Make setup explicit. 2020-07-24 13:13:34 -07:00
test_populate_db.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_presence.py test_presence: Switch data setup from pointer to message flags. 2020-06-27 16:44:38 -07:00
test_push_notifications.py tests: User assertLogs to verify info logs while soft deactivation. 2020-07-27 11:02:17 -07:00
test_queue.py test_queue: Use assertLogs to verify warning in test_queue_error_json. 2020-07-27 11:02:17 -07:00
test_queue_worker.py logging: Report stack_info on logging.exception calls. 2020-08-11 10:16:54 -07:00
test_rate_limiter.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_reactions.py emoji: Rename :slight_smile: to 😄. 2020-07-21 16:49:54 -07:00
test_realm.py test_realm: Use assertLogs to avoid spam in test-backend output. 2020-07-27 11:02:17 -07:00
test_realm_domains.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_realm_emoji.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
test_realm_export.py test_realm_export: Use assertLogs in endpoint tests to verify info log. 2020-07-27 11:02:17 -07:00
test_realm_filters.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_redis_utils.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_report.py test_report: Use assertLogs to avoid spam in test-backend output. 2020-07-27 11:02:17 -07:00
test_retention.py docs: Fix spelling errors caught by codespell. 2020-08-11 10:23:06 -07:00
test_service_bot_system.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
test_sessions.py test_sessions: Use assertLogs to avoid spam in test-backend output. 2020-07-27 11:02:17 -07:00
test_settings.py test_settings: Verify logs of domain mismatch in password change test. 2020-07-27 11:02:17 -07:00
test_signup.py middleware: Make HostDomain into a process_request, not process_response. 2020-08-11 10:37:55 -07:00
test_slack_importer.py tests: Avoid "import logging" for importer tests. 2020-07-24 10:45:59 -07:00
test_slack_message_conversion.py tests: Remove slow tests detection. 2020-06-30 23:34:53 -07:00
test_soft_deactivation.py tests: User assertLogs to verify info logs while soft deactivation. 2020-07-27 11:02:17 -07:00
test_subdomains.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_submessage.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_subs.py test_subs: Remove incorrect encoding before JSON serialization. 2020-08-07 11:14:37 -07:00
test_templates.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_thumbnail.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_timestamp.py timestamp: Remove datetime_to_precise_timestamp for datetime.timestamp. 2020-07-31 22:10:14 -07:00
test_tornado.py test_helpers: Fix instrument_url decorator type. 2020-08-07 10:53:06 -07:00
test_transfer.py tests: Avoid "import logging" in test_transfer. 2020-07-24 10:45:59 -07:00
test_tutorial.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_type_debug.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_typing.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_upload.py export: Only print .s with percent_callback to console. 2020-07-30 13:14:53 -07:00
test_urls.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_user_groups.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_user_status.py user_status: Use strings as dict keys. 2020-08-07 10:53:06 -07:00
test_users.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_webhooks_common.py decorator: Fix type of signature-changing decorators. 2020-06-23 11:29:54 -07:00
test_widgets.py widgets: Make type checks more explicit. 2020-06-25 13:52:59 -07:00
test_zcommand.py settings: Add automatic theme detection feature. 2020-06-21 01:09:01 -07:00
test_zephyr.py logging: Report stack_info on logging.exception calls. 2020-08-11 10:16:54 -07:00