zulip/zerver/tests
Steve Howell bd95b37d67 search: Make `num_after`/`num_after` more consistent.
We now consistently set our query limits so that we get at
least `num_after` rows such that id > anchor.  (Obviously, the
caveat is that if there aren't enough rows that fulfill the
query, we'll return the full set of rows, but that may be less
than `num_after`.)  Likewise for `num_before`.

Before this change, we would sometimes return one too few rows
for narrow queries.

Now, we're still a bit broken, but in a more consistent way.  If
we have a query that does not match the anchor row (which could
be true even for a non-narrow query), but which does match lots
of rows after the anchor, we'll return `num_after + 1` rows
on the right hand side, whether or not the query has narrow
parameters.

The off-by-one semantics here have probably been moot all along,
since our windows are approximate to begin with.  If we set
num_after to 100, its just a rough performance optimization to
begin with, so it doesn't matter whether we return 99 or 101 rows,
as long as we set the anchor correctly on the subsequent query.

We will make the results more rigorous in a follow up commit.
2018-03-15 12:36:06 -07:00
..
images uploads: Convert CMYK to RGB when saving avatar/realm icon as png. 2018-03-02 12:57:22 -08:00
__init__.py
test_alert_words.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_attachments.py lint: Prevent `self: Any` annotations. 2017-12-08 19:00:18 -08:00
test_audit_log.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_auth_backends.py i18n: Fix a last few strings mentioning realms. 2018-03-07 17:15:29 -08:00
test_bots.py org settings: Add setting to prevent users from adding bots. 2018-03-09 13:21:55 -08:00
test_bugdown.py bugdown: Remove email from rendered content of messages with mentions. 2018-03-04 20:04:27 -08:00
test_compatibility.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_custom_profile_data.py i18n: Fix use of 'realm administrator' in translated strings. 2018-03-07 17:15:29 -08:00
test_decorators.py webhooks/github: Log payloads that aren't handled properly. 2018-03-03 15:30:36 -08:00
test_docs.py auth: Redirect to an error page instead of 500. 2018-02-20 22:34:53 -08:00
test_email_change.py settings: Allow admin to change email/name even if it is disabled in realm. 2018-03-02 12:17:00 -08:00
test_email_log.py zerver/tests: Use python 3 syntax for typing. 2017-11-18 15:35:57 -08:00
test_email_mirror.py Add stream ids to urls for stream-related narrows. 2018-02-19 09:03:11 -08:00
test_embedded_bot_system.py embedded bots: Test that BotHandler.initialize is called. 2018-02-28 12:31:38 -08:00
test_event_queue.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_events.py custom profiles: Send custom profile data to frontend. 2018-03-11 18:08:17 -07:00
test_export.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_external.py tests: Replace api_auth usages with auth methods in zerver/tests. 2017-12-18 09:24:09 -05:00
test_feedback.py Add basic test for FeedbackBot. 2018-03-04 13:31:33 -08:00
test_home.py emails: Add backend for disallowing disposable email addresses. 2018-03-11 22:05:58 -07:00
test_hotspots.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_i18n.py Renamed 'Register' to 'Sign up' including translations 2017-12-18 10:02:15 -05:00
test_json_encoder_for_html.py zerver: Remove simplejson dependency. 2017-11-21 21:51:48 -08:00
test_link_embed.py bugdown: Do only image preview if relative URL. 2018-03-06 13:50:02 -08:00
test_logging_handlers.py errors tests: Deduplicate and isolate the magical part. 2017-12-22 11:52:13 -05:00
test_management_commands.py urls: Use /new endpoint for creating new realm. 2018-02-28 13:47:54 -08:00
test_message_edit_notifications.py python: Wrap long def lines in test files. 2017-11-16 22:00:53 -08:00
test_messages.py topic history: Fix fetching topic history of public streams. 2018-03-11 20:59:20 -07:00
test_middleware.py zerver/tests: Use python 3 syntax for typing. 2017-11-18 15:35:57 -08:00
test_muting.py tests: Replace api_auth usages with auth methods in zerver/tests. 2017-12-18 09:24:09 -05:00
test_narrow.py search: Make `num_after`/`num_after` more consistent. 2018-03-15 12:36:06 -07:00
test_new_users.py models: Replace core team with Realm.INITIAL_PRIVATE_STREAM_NAME. 2017-11-21 17:39:51 -08:00
test_notifications.py notifications: Fix missing mypy annotations. 2018-03-09 23:34:14 -08:00
test_outgoing_webhook_interfaces.py zerver/tests: Use python 3 syntax for typing in most files. 2017-11-16 21:52:01 -08:00
test_outgoing_webhook_system.py Add stream ids to urls for stream-related narrows. 2018-02-19 09:03:11 -08:00
test_presence.py tests: Replace api_auth usages with auth methods in zerver/tests. 2017-12-18 09:24:09 -05:00
test_push_notifications.py bugdown: Remove email from rendered content of messages with mentions. 2018-03-04 20:04:27 -08:00
test_queue_worker.py Add tests for SignupWorker error handling. 2018-02-28 12:31:38 -08:00
test_reactions.py reactions: Migrate `emoji_code` to store `id` for realm emoji. 2018-03-09 13:46:27 -08:00
test_realm.py org settings: Add setting to prevent users from adding bots. 2018-03-09 13:21:55 -08:00
test_realm_domains.py i18n: Fix use of 'realm administrator' in translated strings. 2018-03-07 17:15:29 -08:00
test_realm_emoji.py models: Change text representation for realm emoji. 2018-03-11 16:17:47 -07:00
test_realm_filters.py i18n: Fix use of 'realm administrator' in translated strings. 2018-03-07 17:15:29 -08:00
test_report.py zerver/tests: Use python 3 syntax for typing. 2017-11-08 12:50:27 -08:00
test_retention.py Eliminate get_user_profile_by_email from test_classes. 2017-11-26 15:47:56 -08:00
test_service_bot_system.py backend: Call real endpoint in create_test_bot(). 2018-02-09 12:30:24 -08:00
test_sessions.py tests: Pass a realm option to login for non-zulip realms. 2017-11-17 15:32:42 -08:00
test_settings.py settings: Change error for "no data" to something more friendly. 2018-01-23 14:38:59 -05:00
test_signup.py emails: Add backend for disallowing disposable email addresses. 2018-03-11 22:05:58 -07:00
test_slack_importer.py slack importer: Clear 'output_dir' at the beginning of test. 2018-03-08 07:53:09 -08:00
test_slack_message_conversion.py slack importer: Add test for checking link in message conversion. 2018-02-05 14:46:39 -08:00
test_soft_deactivation.py zerver/tests: Use python 3 syntax for typing. 2017-11-08 12:50:27 -08:00
test_stripe.py billing: Make several small style fixes to new tests. 2018-02-12 12:46:01 -08:00
test_subdomains.py zerver/tests: Use python 3 syntax for typing (part 4). 2017-11-21 22:01:19 -08:00
test_subs.py tests: Use iago user in case of admin in `attempt_unsubscribe_of_principal`. 2018-03-14 09:21:14 -07:00
test_templates.py emails: Add backend for disallowing disposable email addresses. 2018-03-11 22:05:58 -07:00
test_timestamp.py zerver/tests: Use python 3 syntax for typing. 2017-11-08 12:50:27 -08:00
test_tornado.py Test MessageSenderWorker with Electron as user agent. 2018-02-28 12:31:38 -08:00
test_tutorial.py zerver/tests: Use python 3 syntax for typing. 2017-11-08 12:50:27 -08:00
test_type_debug.py python: Wrap long def lines in test files. 2017-11-16 22:00:53 -08:00
test_typing.py tests: Replace api_auth usages with auth methods in zerver/tests. 2017-12-18 09:24:09 -05:00
test_unread.py api: Return anchor in get_messages when use_first_unread_anchor=True. 2018-02-16 10:06:20 -08:00
test_upload.py uploads: Make django-sendfile to force downloading attachments. 2018-03-14 11:22:10 -07:00
test_urls.py django-2.0: Shift to resolvers from urlresolvers. 2018-01-30 10:53:54 -08:00
test_user_groups.py user_groups: Fix reporting of empty user groups. 2017-11-29 16:13:55 -08:00
test_users.py emails: Add backend for disallowing disposable email addresses. 2018-03-11 22:05:58 -07:00
test_zephyr.py zerver/tests: Use python 3 syntax for typing (part 3). 2017-11-21 22:01:19 -08:00
tests.py retention-period: Add retention period to front-end admin organization settings. 2017-03-25 17:57:18 -07:00