Commit Graph

442 Commits

Author SHA1 Message Date
rahuldeve c5756e4fa4 Update attachment tracking on message update. 2016-07-10 18:01:59 -07:00
Tim Abbott 05632b68e1 edit: Add validation for setting empty content. 2016-07-10 18:01:59 -07:00
Tim Abbott 0d418d5695 Add some message editing tests for invalid input. 2016-07-10 18:01:59 -07:00
Eklavya Sharma 0900ca5353 Replace assertItemsEqual by assertEqual.
This is needed because assertItemsEqual doesn't exist in python 3.
2016-07-10 17:33:11 -07:00
Rishi Gupta 43c2f35776 Add realm setting to disable message editing.
This is controlled through the admin tab and a new field in the Realms
table.  This mirrors the behavior of the old hardcoded setting
feature_flags.disable_message_editing.  Partially resolves #903.
2016-07-10 11:57:24 -07:00
Eklavya Sharma f1ba3ded42 Revert "Extract reply from email."
This reverts commit f1f48f305e.

The use of sklearn unfortunately caused a substantial slowdown to the
Zulip provisioning process, which didn't seem worth it for a
relatively minor feature.
2016-07-10 11:30:30 -07:00
Steve Howell c671881713 decorators: Extract is_local_addr(). 2016-07-09 17:58:48 -07:00
Eklavya Sharma 801bcdd956 zerver/tests/tests.py: Fix non-deterministic failure.
Replace occurences of list(d.keys()) by sorted(d.keys()).
2016-07-09 17:54:54 -07:00
Eklavya Sharma 2f2e543a0e zerver/tests/tests.py: Replace assertItemsEqual.
Replace assertItemsEqual(a, b) by assertEqual(sorted(a), sorted(b))
because assertItemsEqual has been removed in python 3.
2016-07-09 17:54:54 -07:00
Steve Howell 89105e41d7 Added TestInternalNotifyView. 2016-07-09 07:47:12 -07:00
Steve Howell ce14a3551d Added test_get_client_name(). 2016-07-09 07:37:13 -07:00
Steve Howell 69f18c26fc Improve test_api_key_only_webhook_view().
This test now covers all lines of api_key_only_webhook_view(),
including the error logic and rate limiting logic.
2016-07-09 07:37:13 -07:00
Steve Howell 49543b9ec4 Added RateLimitTestCase tests. 2016-07-09 07:37:13 -07:00
Tim Abbott 1e2d38e790 Move stringify_message_dict into to_dict_uncached. 2016-07-08 17:58:56 -07:00
Umair Khan f1f48f305e Extract reply from email. 2016-07-08 10:58:25 -07:00
Umair Khan 75bd3541ea Add tests for new email policy.
- Update test_extra_context_in_missed_stream_messages
- Add test_extra_context_in_personal_missed_stream_messages
- Add test_extra_context_in_huddle_missed_stream_messages
2016-07-08 10:58:25 -07:00
Eklavya Sharma 4cf7641ab1 zerver/tests/test_i18n.py: Ignore due to incomplete stubs.
In python 3, http.cookies has incomplete stubs.
2016-07-07 12:42:51 -07:00
Kartik Maji f8bb7503e6 Add ability to pin streams to top of the streams sidebar list.
Based on work by Lauren Long, with some tweaks by tabbott.
2016-06-30 22:26:09 -07:00
Kartik Maji a32167d921 test_events: Sort subscribers list.
The subscribers list is appended to in `peer_add` events with not
regard for preserving the ordering, and ordering isn't really
important here, so it seems best to just sort it in these checks.
2016-06-30 16:52:51 -07:00
Vishnu Ks 1cbd39b768 Unique link generator for realm creation. 2016-06-30 15:52:41 -07:00
Alex Wilson 5ec29101eb Add unicode emoji support to bugdown.
Fixes half of #1011.
2016-06-30 15:48:02 -07:00
Tim Abbott 0397855fdd test_hooks: Use send_json_payload for private message tests. 2016-06-30 15:12:03 -07:00
Rishi Gupta 17b6d136d5 Add Semaphore webhook integration. 2016-06-29 16:36:19 -07:00
Eklavya Sharma b76dc9bf4e zerver/lib/upload.py: Fix string types. 2016-06-29 20:43:28 +05:30
Eklavya Sharma d9eb711e5e zerver/tests/test_helpers.py: Use text_type for api_keys.
Also encode/decode strings appropriately when using api_keys to generate
basic auth header.
Also fix clashing annotations in zerver/tests/test_external.py.
2016-06-29 01:50:38 +05:30
acrefoot a36e5d4987 Add get_auth_backends endpoint to API.
We would like to know which kind of authentication backends the server
supports.

This is information you can get from /login, but not in a way easily
parseable by API apps (e.g. the Zulip mobile apps).
2016-06-27 18:30:34 -07:00
Tim Abbott b2a24e0306 Revert "Add authorization check before serving files."
This reverts commit e985b57259.

This commit will break production when we next do a release, because
we haven't done a migration to create Attachment objects for
previously uploaded files.
2016-06-27 12:09:56 -07:00
Tim Abbott f7e87bc1f0 test_helpers: Require that login calls actually succeed.
This caught several bugs where test code wasn't doing what it's author
intended.
2016-06-27 11:51:04 -07:00
Tim Abbott 4cac7bbb32 test_helpers: Refactor login test helpers.
We now have a separate login helper for the case where the return
value is desired.
2016-06-27 11:50:43 -07:00
Tim Abbott a05c03d3b5 test_messages: Fix trying to login as a bot user.
Due to a recent refactoring, the first user in the subscribers list is
now a bot.
2016-06-27 11:48:39 -07:00
Tim Abbott 370b38696a test_messages: Fix broken huddle messages test.
The second login call was failing because the user didn't exist.
2016-06-27 11:48:36 -07:00
rahuldeve e985b57259 Add authorization check before serving files. 2016-06-27 11:24:35 -07:00
rahuldeve 674def30ee Add support for serving files using API authentication.
Also remove 'get_uploaded_file' view function and the corresponding
old '/user_upload/' url pattern.
2016-06-27 11:00:41 -07:00
rahuldeve 823bf15c6e Add API route for uploading files. 2016-06-27 10:30:58 -07:00
acrefoot e4ed9195dc Remove rest_dispatch hack and optimize imports.
For a long time, rest_dispatch has had this hack where we have to
create a copy of it in each views file using it, in order to directly
access the globals list in that file.  This removes that hack, instead
making rest_dispatch just use Django's import_string to access the
target method to use.

[tweaked and reorganized from acrefoot's original branch in various
ways by tabbott]
2016-06-24 16:11:03 -07:00
Tim Abbott 45beac7d6c test_decorators: Add test for /json/fetch_api_key. 2016-06-21 16:14:22 -07:00
Tomasz Kolek 7aa45ffa45 Increase send_message_backend coverage. 2016-06-21 14:33:21 -07:00
Tim Abbott 50f723f50b Split test_narrow.py out of test_messages.py. 2016-06-21 12:25:08 -07:00
Tomasz Kolek e3e03e2946 Add NarrowBuilder test cases.
Refactor existing add_term test cases.
2016-06-21 11:53:31 -07:00
Tomasz Kolek f8c368c07f Add default-bot during populate_db. 2016-06-21 11:47:38 -07:00
Tomasz Kolek 9ae68ade8b Add is_webhook option to authentication decorats.
Modified:
authenticated_rest_api_view
authenticated_api_view and validate_api_key.
2016-06-21 11:47:38 -07:00
Vishnu Ks ad1c3894d9 Add interface for creating new realms.
This is controlled by settings.OPEN_REALM_CREATION; if that setting is
off, this feature doesn't do anything.
2016-06-17 16:15:28 -07:00
kunall17 007eee6061 Add route to fetch emails for mobile passwordless login.
[Tweaked by tabbott to rename API to explicitly support not just
Android]
2016-06-17 11:03:19 -07:00
kunall17 7ea0eaed1c Add passwordless login for mobile app development.
[Tweaked by tabbott to rename API to explicitly support not just
Android].
2016-06-17 10:58:33 -07:00
Tomasz Kolek 76cbe89613 Add IFTTT integration. 2016-06-16 15:30:45 -07:00
Tim Abbott 33df0b29d3 Annotate zerver/tests/test_hooks.py. 2016-06-16 14:07:34 -07:00
Tim Abbott 5b05644c95 Run mypy on zerver/tests/test_hooks.py. 2016-06-16 14:07:34 -07:00
Tim Abbott 6723525fd3 Annotate zerver/tests/tests.py. 2016-06-16 14:07:34 -07:00
Tim Abbott 45883386ce AlertWordTests: Cleanup confusing message variable reuse. 2016-06-16 13:55:58 -07:00
Tim Abbott 10dd9addb7 Fix ChangeSettingsTest caching issue causing test failures. 2016-06-15 14:57:58 -07:00