zulip/zerver/tests
Mateusz Mandera 8c065d1fcd ldap: Ensure django_to_ldap_username returns username that is in ldap.
This changes the way django_to_ldap_username works to make sure the ldap
username it returns actually has a corresponding ldap entry and raise an
exception if that's not possible. It seems to be a more sound approach
than just having it return its best guess - which was the case so far.
Now there is a guarantee that what it returns is the username of an
actual ldap user.

This allows communicating to the registration flow when the email being
registered doesn't belong to ldap, which then will proceed to register
it via the normal email backend flow - finally fixing the bug where you
couldn't register a non-ldap email even with the email backend enabled.

These changes to the behavior of django_to_ldap_username require small
refactorings in a couple of other functions that call it, as well as
adapting some tests to these changes. Finally, additional tests are
added for the above-mentioned registration flow behavior and some
related corner-cases.
2019-10-25 12:14:51 -07:00
..
fixtures tests: Add some logic to ZulipTestCase to prepare to migrate ldap tests. 2019-10-17 16:49:53 -07:00
images emoji: Only resize custom emoji that need it. 2019-01-29 10:33:50 -08:00
__init__.py
test_alert_words.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_archive.py archives: Change the topic/<topic_name> code path to use topics prefix. 2018-07-14 10:39:35 +05:30
test_attachments.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_audit_log.py billing: Sync realm activation events for on-prem billing. 2019-10-08 17:18:30 -07:00
test_auth_backends.py ldap: Ensure django_to_ldap_username returns username that is in ldap. 2019-10-25 12:14:51 -07:00
test_bots.py users: Refactor get_members_backend endpoint to use get_raw_user_data. 2019-10-23 14:50:26 -07:00
test_bugdown.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_cache.py generic_bulk_cached_fetch: Only call query_function if necessary. 2019-08-15 17:14:02 -07:00
test_camo.py camo: Add endpoint to handle camo requests. 2019-01-04 10:27:04 -08:00
test_compatibility.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_create_video_call.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_custom_profile_data.py users: Refactor get_members_backend endpoint to use get_raw_user_data. 2019-10-23 14:50:26 -07:00
test_decorators.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_digest.py models: Migration of Message.pub_date to date_sent, part 2. 2019-10-05 19:01:34 -07:00
test_docs.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_email_change.py urls: Tighten many unintentionally broad URL patterns. 2019-08-26 20:51:49 -07:00
test_email_log.py emails: Don't log emails while running test suite. 2018-10-11 15:12:08 -07:00
test_email_mirror.py email_mirror: Ignore missed message email if the user isn't active. 2019-09-20 17:58:10 -07:00
test_email_notifications.py tests: Add ldap_username() and ldap_password() method. 2019-10-22 16:03:58 -07:00
test_embedded_bot_system.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_event_queue.py messages: Add email/push notifications for wildcard mentions. 2019-08-26 14:39:53 -07:00
test_events.py test_events: Fix a small typo for test_realm_bots_admin. 2019-10-23 14:35:32 -07:00
test_external.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_feedback.py Add basic test for FeedbackBot. 2018-03-04 13:31:33 -08:00
test_gitter_importer.py tests: Move get_set to ZulipTestCase. 2019-05-21 14:10:29 -07:00
test_hipchat_importer.py hipchat: Limit messages in slim mode. 2018-11-26 16:37:30 -08:00
test_home.py models: Replace is_guest and is_realm_admin with UserProfile.role. 2019-10-06 16:24:37 -07:00
test_hotspots.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_i18n.py tests: tearDown overrides should call super().tearDown(). 2019-10-18 13:36:59 -07:00
test_import_export.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_integrations_dev_panel.py webhooks: Replace headers parsing logic with a common source. 2019-06-24 13:23:21 -07:00
test_ldap.py ldap: Ensure django_to_ldap_username returns username that is in ldap. 2019-10-25 12:14:51 -07:00
test_legacy_subject.py Add alias support to REQ helpers for subject/topic. 2018-11-12 15:47:11 -08:00
test_link_embed.py url preview: Replace YouTube URLs with their titles. 2019-07-12 19:14:19 -07:00
test_logging_handlers.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_management_commands.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_mattermost_importer.py test_mattermost_importer: Fix leftover references to message.pub_date. 2019-10-11 04:07:12 +02:00
test_message_edit_notifications.py messages: Add email/push notifications for wildcard mentions. 2019-08-26 14:39:53 -07:00
test_messages.py tests: Clean up and extend topic links tests in test_messages. 2019-10-16 17:39:09 -07:00
test_middleware.py open graph: Uploaded realm icon URL is absolute for some backends. 2019-05-20 13:14:28 -07:00
test_migrations.py test_migrations: Disable migrations test. 2019-05-12 22:06:17 -07:00
test_muting.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_narrow.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_new_users.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_onboarding.py create_realm_internal_bots: Refactor to extract main op as a function. 2018-05-23 11:53:22 +05:30
test_openapi.py events: Fix documentation testing for /events. 2019-10-21 16:50:10 -07:00
test_outgoing_webhook_interfaces.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_outgoing_webhook_system.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_populate_db.py models: Migration of Message.pub_date to date_sent, part 2. 2019-10-05 19:01:34 -07:00
test_presence.py test_presence: Prepare for moving system bots to zulipinternal. 2019-07-20 14:55:21 -07:00
test_push_notifications.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_queue_worker.py queue: Don't create confirmation objects twice during invite. 2019-10-10 16:19:42 -07:00
test_queue.py tests: tearDown overrides should call super().tearDown(). 2019-10-18 13:36:59 -07:00
test_reactions.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_realm_domains.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_realm_emoji.py get_realm: raise DoesNotExist instead of returning None. 2019-05-06 21:58:16 -07:00
test_realm_export.py billing: Change RealmAuditLog.event_type from str to int. 2019-10-06 15:55:56 -07:00
test_realm_filters.py linkifiers: Allow semicolons in target URLs. 2019-05-14 11:17:55 -07:00
test_realm.py confirmation: Set confirmation object realm attribute in realm reactivation. 2019-10-21 16:52:46 -07:00
test_report.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_retention.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_service_bot_system.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_sessions.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_settings.py tests: Add ldap_username() and ldap_password() method. 2019-10-22 16:03:58 -07:00
test_signup.py ldap: Ensure django_to_ldap_username returns username that is in ldap. 2019-10-25 12:14:51 -07:00
test_slack_importer.py models: Replace is_guest and is_realm_admin with UserProfile.role. 2019-10-06 16:24:37 -07:00
test_slack_message_conversion.py test_slack_message_conversion: Use subTest for fixtures test. 2019-09-13 11:54:14 -07:00
test_soft_deactivation.py soft-deactivation: Run catch-up when "auto" deactivate is run. 2019-03-14 11:53:15 -07:00
test_subdomains.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_submessage.py events: Pass a realm object into send_event. 2018-11-02 16:47:39 -07:00
test_subs.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_templates.py support: Pass various realm functions as template context. 2019-10-21 16:52:46 -07:00
test_thumbnail.py lint: Fix code that evaded our lint checks for string % non-tuple. 2019-04-23 15:21:37 -07:00
test_timestamp.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_tornado.py events: Check last_event_id for validity, take 2. 2019-08-05 17:18:49 -07:00
test_transfer.py management: Add tooling for transfering local uploads to s3. 2019-02-14 14:31:46 -08:00
test_tutorial.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_type_debug.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_typing.py test_typing: Prepare for moving system bots to zulipinternal. 2019-07-20 14:55:21 -07:00
test_unread.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_upload.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_urls.py urls: Tighten many unintentionally broad URL patterns. 2019-08-26 20:51:49 -07:00
test_user_groups.py test_user_groups: Eliminate hard-coded user ids. 2019-08-21 21:28:09 -07:00
test_user_status.py user status: Add "status_text" support in the backend. 2019-01-24 09:46:35 -08:00
test_users.py models: Replace is_guest and is_realm_admin with UserProfile.role. 2019-10-06 16:24:37 -07:00
test_webhooks_common.py webhooks: Eliminate the usage of a headers.py file. 2019-06-26 10:35:14 -07:00
test_widgets.py widgets: Remove ALLOW_SUB_MESSAGES flag and enable widgets by default. 2019-01-29 09:34:14 -08:00
test_zcommand.py zcommand: Raise error when command doesn't begin with a slash. 2018-07-01 20:32:36 -04:00
test_zephyr.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00