Commit Graph

4193 Commits

Author SHA1 Message Date
Umair Khan 4f9b6303a7 test_narrow.py: Add workaround for Pgroonga regression.
Due to Pgroonga regression, there is a difference in search
result between Travis and development env due to which one of
our tests fails. This commit makes sure that the test passes
for both strings till the Pgroonga bug is resolved.
2017-03-29 22:12:15 -07:00
Sarah dea563b27e zerver/lib/test_events: Refactor realm update tests.
Created do_set_realm_property_test and refactored individual realm tests
to use this function for testing updating realm properties.
2017-03-30 02:17:10 +00:00
Rishi Gupta 754b547e88 populate_db: Change enter_sends to True for development users.
Fixes #4355.
2017-03-29 18:38:30 -07:00
Tim Abbott 9aa77e491e tests: Get hotspots to 100% test coverage. 2017-03-29 14:04:33 -07:00
Amy Liu 6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00
Umair Khan 33c130a603 Make pgroonga tests pass to workaround pgroonga regression.
Note that the old behavior was correct; we're just merging this to
make the tests pass until upstream can fix it.
2017-03-29 11:32:37 -07:00
Tim Abbott 9a9f0f86e9 test_messages: Fix sometimes incomplete coverage in StarTests.
This test had nondeterministically incomplete test coverage.
2017-03-28 11:41:45 -07:00
Tim Abbott 5776ecfac2 test_audit_log: Fix unnecessary user creation. 2017-03-27 13:23:10 -07:00
Maxim Averin f213369e1d zerver: Replace log_event with RealmAuditLog in do_change_avatar_fields. 2017-03-27 13:23:10 -07:00
Tim Abbott 141469399b RealmAuditLog: Add an extra_data field.
This will be useful for logging any additional details that we might
want to display.
2017-03-27 13:22:58 -07:00
Eeshan Garg 8933b5b31d github_webhook: Filter specific GitHub branches.
Fixes: #4000
2017-03-26 13:32:24 -07:00
Tim Abbott db92dec05e test_events: Start using test_dict_only.
This is a proof of concept; we'll want to migrate the rest of the call
points soon.
2017-03-26 13:10:54 -07:00
Tim Abbott 2160088d94 test_events: Enforce length of events list. 2017-03-26 13:10:54 -07:00
Tim Abbott 118f2db22d validators: Add a test_dict_only validator that bans other arguments.
This is primarily intended to be useful in EventsRegisterTest.
2017-03-26 13:10:54 -07:00
Tim Abbott b5cf0067d5 logging_handlers: Avoid super long subject lines. 2017-03-26 13:10:43 -07:00
Tim Abbott 36bb2bf54a AdminZulipHandler: Bring logging_handlers.py to 100% test coverage.
This involved fixing some unupdated code in one code path.
2017-03-26 13:10:43 -07:00
Tim Abbott 267346f5fb AdminZulipHandler: Support passing a record without a request. 2017-03-26 13:10:43 -07:00
Tim Abbott efa151b488 AdminZulipHandler: Extract add_request_metadata. 2017-03-26 13:10:43 -07:00
Tim Abbott 4276face7f AdminZulipHandler: Construct report more dynamically. 2017-03-26 13:10:43 -07:00
Tim Abbott 1a17b11788 logging_handlers: Add tests for main error reporting code path. 2017-03-26 13:10:43 -07:00
Tim Abbott 033fd98e5f decorator: Add rate limiting to zulip_login_required. 2017-03-26 13:10:43 -07:00
Tim Abbott 385551ff62 decorator: Add rate-limiting to JSON views. 2017-03-26 13:10:43 -07:00
Tim Abbott 6c4c8178f0 zulip_login_required: Set request._query.
This fixes an exception we had in the user_activity queue processor
when changing email addresses, since the URL containing the
confirmation key was longer than 50 characters.
2017-03-26 13:10:43 -07:00
Bao Chau 9b6e648acb registration: Fetch length limits from the backend's actual sizes.
This makes these more likely to remain accurate over time.

Fixes #4211.
2017-03-25 20:10:12 -07:00
Rishi Gupta 30024d0a8f models: Remove Realm.domain. 2017-03-25 19:55:48 -07:00
Rishi Gupta b416587aab Change sender_domain to sender_realm_str in message dict. 2017-03-25 19:50:24 -07:00
Rishi Gupta 88abb7871d Remove domain from list of pre-fetched fields for message recipients. 2017-03-25 19:50:24 -07:00
Harshit Bansal 11327fda7c actions.py: Only admins and bot's owner should recieve bot related events.
Modify `bot_owner_user_ids()` to return the user_ids of only
admins and bot owners instead of all the current active users.
This was causing a traceback on the frontend.

Fixes: #3391.
2017-03-25 18:22:15 -07:00
Elliott Jin 98ddb4453e test-backend: Raise zerver/views/home.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
Elliott Jin 1c0d58f897 test-backend: Raise zerver/views/auth.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
K.Kanakhin fe3213798d retention: Add models to store expired messages.
This addresses part of #106.
2017-03-25 18:12:06 -07:00
Tim Abbott 18e66983c4 signals: Fix mypy error. 2017-03-25 18:06:04 -07:00
K.Kanakhin 234a1f8e61 retention-period: Add retention period to front-end admin organization settings.
- Add message retention period field to organization settings form.
- Add css for retention period field.
- Add convertor to not negative int or to None.
- Add retention period setting processing to back-end.
- Fix tests.

Modified by tabbott to hide the setting, since it doesn't work yet.
The goal of merging this setting code now is to avoid unnecessary
merge conflicts in the future.

Part of #106.
2017-03-25 17:57:18 -07:00
Tim Abbott 6a884acff5 signals: Avoid importing bugdown from early initialization.
This fixes `tools/build-release-tarballs` failing.
2017-03-25 17:27:46 -07:00
Tim Abbott 004133561b realm_filters: Support ? in URL format strings. 2017-03-25 17:13:34 -07:00
Tim Abbott 22d284950d trello: Clean up the documentation. 2017-03-25 17:04:52 -07:00
hollywoodno 75d9630258 Add notifications on new logins to Zulip.
This adds helpful email notifications for users who just logged into a
Zulip server, as a security protection against accounts being hacked.

Text tweaked by tabbott.

Fixes #2182.
2017-03-25 16:50:52 -07:00
Tim Abbott 7bcf24d39c test_management_commands: Reset settings.RUNNING_INSIDE_TORNADO.
This fixes a leak of this setting change that resulted from the
unusual way that our Tornado system sets this variable early in the
management command.

Fixes #3685.
2017-03-23 23:56:10 -07:00
Tim Abbott 3617ebfd41 api: Rename get_old_messages to get_messages in the backend.
Fixes #1315.
2017-03-23 23:52:44 -07:00
wizsid11 95789eb879 Add Slack webhook.
Adds a new webhook integration for Slack to receive messages
from one's Slack team's public channels.
Contains negative tests for broken, missing or invalid data.

Allows two different option for integration:
1. Receive notification on a single stream with different topics
for each of Slack's public channels.
2. Receive notification on different streams for each of Slack's
public channels.

Steps to choose between the two options is described in the documentation.

Fixes #3569.
2017-03-23 23:32:38 -07:00
Tomasz Kolek be0a2cb20b Add basecamp3 webhook integration.
Fixes: #3949.
2017-03-23 23:28:53 -07:00
Tomasz Kolek 09f5180da9 github_webhook: Return 200 OK if event is not supported.
Change raising exception when event is not supported to just logging it.
2017-03-23 23:26:55 -07:00
Tomasz Kolek fcd091132d jira: Return 200 OK if event is not supported. 2017-03-23 23:26:55 -07:00
Tim Abbott a6ae546f59 test_events: Bring zerver/lib/events.py to 100% coverage. 2017-03-23 22:43:10 -07:00
Tim Abbott 0c16cc1c1e test_events: Add a test for do_refer_friend. 2017-03-23 22:43:10 -07:00
Tim Abbott 055a18e71f test_events: Add a test for do_update_embedded_data. 2017-03-23 22:43:10 -07:00
Tim Abbott eb19a25aba events: Fix races in stream creation event and add tests.
This fixes 2 issues:
* Being added to an invite_only stream did not correctly update the
  "streams" key of the initial state.

* Once that's resolved, subscribe_to_stream when called on a
  nonexistant stream would both send a "create" event (from
  create_stream_if_needed) and an "occupy" event (from
  bulk_add_subscriptions).

  The second event should just be suppressed in that case, and this
  implements that suppression.
2017-03-23 22:43:09 -07:00
Tim Abbott 8eb020d190 test_events: Add a test for do_update_muted_topic. 2017-03-23 22:27:39 -07:00
Tim Abbott dbe3ea59aa test_events: Add a failing presence test.
Apparently our presence real-time sync is slightly broken; this test
at least reveals that fact.
2017-03-23 22:27:39 -07:00
Tim Abbott d1760a1bb9 validators: Add check_float validator. 2017-03-23 21:23:41 -07:00