Commit Graph

6796 Commits

Author SHA1 Message Date
Tomasz Kolek
64b5d0ce64 Add support for inviting emails in "name" <email> format.
Often, users will copy email addresses with a name (rather than pure
email addresses) into the Zulip "invite users" UI.  Previously, that
would throw an error.

This change also adds a get_invitee_emails_set function for parsing
emails content and a test suite for this new feature.

Fixes: #1419.
2016-08-05 14:48:04 -07:00
Umair Khan
d33fc0046f Add APNS feedback server tests. 2016-08-05 10:36:57 -07:00
Umair Khan
33450d1a0b Add APNS push notification tests. 2016-08-05 10:36:57 -07:00
Umair Khan
40054ce26c Add APNS response listener test case. 2016-08-05 10:36:57 -07:00
Umair Khan
df8fc30b75 Create MockRedis class.
Redis is not available on Travis and creating a mock Redis server looks
easier than using `mock` module.
2016-08-05 10:36:57 -07:00
Umair Khan
2ab796aeb5 Add tests for APNS message. 2016-08-05 10:36:57 -07:00
Tim Abbott
dcb92d41b8 Annotate test_messages.py. 2016-08-04 15:57:04 -07:00
Tim Abbott
39f1024740 test_messages: Fix remaining mypy errors. 2016-08-04 15:57:03 -07:00
Tim Abbott
4e8054b84a Refactor queue worker tests to match actual API. 2016-08-04 15:57:03 -07:00
Tim Abbott
4f782bc186 test_events: Fix annotation gaps. 2016-08-04 15:57:03 -07:00
Tim Abbott
d00719f204 Annotate IFTTT tests. 2016-08-04 15:57:03 -07:00
Tim Abbott
d449f6ba72 Annotate bitbucket2 tests. 2016-08-04 15:57:03 -07:00
Tim Abbott
cc11229377 test_auth_backends: Add missing type annotations. 2016-08-04 15:57:02 -07:00
Tim Abbott
55611cd21a Annotate test_i18n.py. 2016-08-04 15:53:23 -07:00
Tomasz Kolek
0e33b8bd4d Add integrations library.
Define Integration and WebhookIntegration classes.
Change webhook part of integration's guide.
Replace hardcoded webhook urls to generating
based on WEBHOOKS list.
2016-08-04 11:39:20 -07:00
Umair Khan
b38ca0c690 Add tests for GitHub team and organization auth. 2016-08-03 12:01:15 -07:00
Umair Khan
fc1d8e217f Don't pass return_data to mock functions.
GitHubAuthBackend already passes the `return_data` keyword argument
to the `do_auth` function.
2016-08-03 12:01:15 -07:00
Umair Khan
2f6293027d Add test for empty email gateway pattern. 2016-07-31 20:39:09 -07:00
Rag Sagar
b9f2397073 Add validation and tests for default language setting. 2016-07-31 17:44:10 -07:00
Christie Koehler
31efecf03d Add HelloWorld webhook integration + Walkthough.
Improves webhook integration docs and Hello World webhook.  Includes
many suggested improvements from @timabbott and @tomaszkolek.
2016-07-29 21:38:40 -07:00
Tim Abbott
297566510c test_activity: Increase expected query count by 1.
This is required because the Zulip UserProfile caching logic has
changed with 8e5e6a06f2, and sometimes
the current user will not be in the cache.
2016-07-29 21:15:10 -07:00
Tim Abbott
f7083b4079 test_templates: Fix Python 3 compatibility. 2016-07-29 21:11:27 -07:00
acrefoot
b7ccf64c79 Move Zulip's TOS to TERMS_OF_SERVICE markdown file.
This reimplements zulip.com/terms using the new markdown system.
2016-07-29 20:47:42 -07:00
acrefoot
e568dbc76f Add TERMS_OF_SERVICE setting.
This new setting allows the server administrator to add a custom
Terms of Service page by supplying the path to a markdown file.

Also adds a test.
2016-07-29 20:47:31 -07:00
Tim Abbott
700e803840 settings: Add new DEBUG_RATE_LIMITING setting.
This exists primarily in order to allow us to mock settings.DEBUG for
the purposes of rate limiting, without actually mocking
settings.DEBUG, which I suspect Django never intended one to do, and
thus caused some very strange test failures (see
https://github.com/zulip/zulip/pull/776 for details).
2016-07-29 19:32:02 -07:00
Eklavya Sharma
5691ca61b0 Add tests for email_mirror management command. 2016-07-29 19:13:52 -07:00
Steve Howell
9fb071947d Remove expected_run_time from @slow test decorator. 2016-07-29 16:41:21 -07:00
Steve Howell
f67b56702a Remove @slow decorators for tests that are no longer slow.
These tests aren't exactly zippy, but they don't even make
the top 100 slow tests.
2016-07-29 16:41:21 -07:00
Tim Abbott
6b2b7ab3ff Rename GitHubBackend to GitHubAuthBackend for consistency. 2016-07-29 12:49:10 -07:00
Umair Khan
d43b031a32 Add tests to verify GitHub backend. 2016-07-29 12:49:10 -07:00
Steve Howell
ffe364c719 Don't pass UserProfile object to client_put().
This was in AdminCreateUserTest.test_create_user_backend().
For end to end tests we are logged in, and we need to verify
that our decorators add UserProfile to the parameters of
the view on our behalf, so that we don't get false positives.

In an upcoming commit, we will want to be able to serialize
the parameters for client_put to produce url coverage reports,
so that is another reason not to pass in the UserProfile
object.  (That was how this was discovered.)
2016-07-28 13:57:28 -07:00
Steve Howell
985de51903 Use self.client_delete() wrapper in more places. 2016-07-27 20:49:33 -07:00
Steve Howell
6937f63fd5 Add client_get() test helper. 2016-07-27 20:49:33 -07:00
Steve Howell
38f2a2f475 Add client_post() test helper.
This makes us more consistent, since we have other wrappers
like client_patch, client_put, and client_delete.

Wrapping also will facilitate instrumentation of our posting code.
2016-07-27 20:49:32 -07:00
Steve Howell
51bae8abc4 Remove stub() test helper. 2016-07-27 14:12:10 -07:00
rahuldeve
ec6c9ba436 Add test for removing an uploaded file via message editing.
Fixes #1373.
2016-07-27 14:10:15 -07:00
Tim Abbott
375551aaa6 Clean up most hardcoding of mit.edu domain checks.
This moves all this code to be gated on a few virtual realm settings.
2016-07-26 20:30:12 -07:00
Tim Abbott
70543e059a bugdown: Remove hardcoding of mit.edu for zephyr_mirror realm config. 2016-07-26 20:30:12 -07:00
Tim Abbott
c17676b00c Cleanup MIT hardcoding for disabling presence. 2016-07-26 20:30:12 -07:00
Steve Howell
eb11e02309 Add MirroredMessageUsersTest. 2016-07-26 20:01:36 -07:00
Steve Howell
81cd9d33e4 Add test_non_string_narrow_operand_in_dict(). 2016-07-26 18:10:00 -07:00
Eklavya Sharma
5ce80eb4ba Update types of images accepted as avatars.
* Reject SVG in frontend because backend doesn't accept it.
* Add JPEG format in backend tests for avatar upload.
2016-07-26 16:36:47 +05:30
Eklavya Sharma
a2a8b54f6e Upgrade pillow.
Update test images because pillow's resize algorithm has changed.
2016-07-26 16:36:07 +05:30
rahuldeve
5ed2b01bc7 upload: Fix single attachments not being claimed on message edit.
Fixed an attachments not being claimed if just one new attachment is
added (aka the common case).
2016-07-25 17:56:27 -07:00
Ashish Kumar
8398dac025 Fix 'Invalid stream' error message in get_subscription_or_die(). 2016-07-25 14:48:48 -07:00
Ashish Kumar
56048919f5 Increase test coverage of streams API by covering JSON errors. 2016-07-25 14:48:48 -07:00
Ashish Kumar
84566c750f Add test_successful_subscriptions_add_with_announce(). 2016-07-25 14:45:29 -07:00
Ashish Kumar
a143677ea2 Add test_json_get_subscribers(). 2016-07-25 14:45:28 -07:00
Ashish Kumar
9104468926 Add test_existing_subscriptions_autosubscription(). 2016-07-25 14:43:27 -07:00
Steve Howell
2846e23cfc Extracted test helper: get_and_check_messages().
This new helper combines two old helpers, one of which was misnamed
and the other of which was always called after the first, so it
made sense to just combine the helpers.

Fixes: #1386
2016-07-24 19:43:56 -07:00