Commit Graph

7965 Commits

Author SHA1 Message Date
Harshit Bansal
fe4cba9aa7 test_events.py: Remove any remaining occurrences of alias. 2017-04-04 15:48:03 -07:00
Harshit Bansal
711a3f8037 actions.py: Rename remaining occurrences of alias' to realm_domain`. 2017-04-04 15:48:03 -07:00
Harshit Bansal
c226c651f7 actions.py: Rename do_remove_realm_alias() to do_remove_realm_domain(). 2017-04-04 15:48:03 -07:00
Harshit Bansal
a08155b09e actions.py: Rename do_change_realm_alias() to do_change_realm_domain(). 2017-04-04 15:48:03 -07:00
Harshit Bansal
2da4fc0dc4 actions.py: Rename do_add_realm_alias() to do_add_realm_domain(). 2017-04-04 15:48:03 -07:00
Harshit Bansal
ac2172e233 models: Rename RealmAlias model to RealmDomain.
Includes a migration.
2017-04-04 15:48:03 -07:00
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
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
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
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
1a17b11788 logging_handlers: Add tests for main error reporting code path. 2017-03-26 13:10:43 -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
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
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
004133561b realm_filters: Support ? in URL format strings. 2017-03-25 17:13:34 -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
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
Tim Abbott
12a6913bbf test_events: Add a test for do_update_message_flags. 2017-03-23 21:11:33 -07:00
Tim Abbott
2b905d242d events: Fix timezone realm-time sync and add test. 2017-03-23 19:11:34 -07:00
Tim Abbott
86e3d1effc events: Fix default language realm-time sync and add test.
We previously didn't apply the default language event change
correctly.

Not super important as a bug, since we require the user to reload the
browser for their changes to take effect, but this will save time if
we ever change that.
2017-03-23 19:08:17 -07:00
Tim Abbott
99515c2d34 test_events: Add tests for default streams being None. 2017-03-23 19:04:13 -07:00
Tim Abbott
adcf8263d6 tests: Fix passing non-unicode strings to do_set_realm_property.
This fixes test failures on Python 3 caused by
a98bce98c6.
2017-03-23 18:37:12 -07:00
Sarah Stringer
09f66b5c6d actions: Add do_set_realm_property function and migrate to it.
zerver/lib/actions: removed do_set_realm_* functions and added
do_set_realm_property, which takes in a realm object and the name and
value of an attribute to update on that realm.

zerver/tests/test_events.py: refactored realm tests with
do_set_realm_property.

Kept the do_set_realm_authentication_methods and
do_set_realm_message_editing functions because their function
signatures are different.

Addresses part of issue #3854.
2017-03-23 17:52:45 -07:00
Umair Khan
2d4a1f93ff testing: Bring zproject.backends coverage to 100%. 2017-03-23 17:12:58 -07:00
Akash Kothawale
4c2bfae83e get_stream: Throw DoesNotExist if stream is not found.
This makes get_stream match get_realm, get_user_profile_by_email,
etc., in interface, and is more convenient for mypy annotations
because `get_stream` now doesn't return an Optional[Stream].
2017-03-23 15:42:00 -07:00
Tim Abbott
97e844e97c test_notifications: Don't pass a user_profile to client_patch.
This fixes a JSON overflow error when producing URL coverage reports.
2017-03-23 13:08:49 -07:00
Tim Abbott
f3af0fe635 reactions: Fix reacting to messages on streams you're not subscribed to.
We use the same strategy Zulip already uses for starred messages,
namely, creating a new UserMessage row with the "historical" flag set
(which basically means Zulip can ignore this row for most purposes
that use UserMessage rows).  The historical flag is ignored, however,
in determining which users' browsers to notify about new reactions,
and thus the user will get to see the reaction appear when they click
a message (and any reactions other users later add, as well!).

There's still something of a race here, in that if some users react to
a message while the user is looking at the unsubscribed stream but
before the user reacts to that message, those reactions will not be
displayed to that user (so counts will be a bit lower, or something).
This race feels small enough to ignore for now.

Fixes #3345.
2017-03-22 20:22:13 -07:00
Tim Abbott
60326ca94c test_events: Add reaction tests. 2017-03-22 20:22:02 -07:00
Tim Abbott
0fec03f8bb test_docs: Fix normal users test text. 2017-03-22 13:14:19 -07:00
sinwar
397e9c109e auth: Separate development login from main login page.
This allows us to enable EmailAuthBackend by default in development
without cluttering the development login experience.

Fixes #3652.
2017-03-22 12:54:30 -07:00