Commit Graph

11910 Commits

Author SHA1 Message Date
Umair Khan
7a84f12a38 Verify mock calls without strict order.
In push notification tests, call assert_has_calls with `any_order=True`
so that the order of the calls does not matter.
2016-08-09 22:15:37 +05:00
Tim Abbott
42b63f5caa test_templates: Fix failure to report a user-facing error. 2016-08-09 09:54:44 -07:00
Tim Abbott
f3365f4089 test_templates: Add integrations_dict to context.
This fixes the fact that this test was (silently) failing.
2016-08-09 09:54:36 -07:00
Umair Khan
25f70ebdaa Annotate zproject/jinja2/backends.py 2016-08-09 09:19:24 -07:00
Umair Khan
60f30fdb36 Annotate zproject/backends.py. 2016-08-09 09:19:24 -07:00
Umair Khan
fe812a89bf mypy: Type of remote_username should be text_type. 2016-08-09 09:19:24 -07:00
Brock Whittaker
e34b9be950 Append color picker to #subscriptions_table instead of document.body.
Adding the container attribute to the color picker options parameter
modifies the behavior of the spectrum function to allow the color
picker to be attached to the #subscriptions_table element rather than
the default document.body element.

This allows for the color picker to scroll with the subscriptions page,
fixing the bug where the color picker would not scroll up/down the page.

Fixes #1293.
2016-08-09 09:07:55 -07:00
Brock Whittaker
eda1cdd0c5 third: Add option for which container to append the color picker to.
This allows you to select the container that the color picker should
append to and therefore be absolutely positioned in accordance with.

This still defaults to document body, which was the previously default
container to append the color picker to.
2016-08-09 09:07:15 -07:00
Brock Whittaker
77aa43fffb Prevent the color-picker from appearing above the navbar.
The color picker original z-index was set to (2^31)-1 which overrode
everything on the site. This behavior is unwanted as the color picker
should not override the z-index of the navbar.

In changing the z-index to 100 the navbar remains above the color
picker.
2016-08-09 09:07:15 -07:00
Umair Khan
8c249f859e Push Notification: Add tests for GCM. 2016-08-09 16:13:02 +05:00
Steve Howell
a904222947 Add tools/find-add-class to tools/lint-all.
The find-add-class tool, when in lint mode, verifies that we can
understand all calls to addClass from our JS code.

When in non-lint mode, i.e. verbose mode, the tool prints out a
list of tuples of (fn, class) that we can use as we wish in other
tools.
2016-08-08 15:32:48 -07:00
Steve Howell
15f46a142e Remove obsolete #navbar-spacer style. 2016-08-08 15:24:45 -07:00
Steve Howell
98abe5bb3b Remove obsolete #left-of-compose style. 2016-08-08 15:24:45 -07:00
Steve Howell
95b19f9765 Add test_validate_django(). 2016-08-08 15:20:29 -07:00
Steve Howell
d29e745142 Add test_validate_handlebars(). 2016-08-08 15:20:29 -07:00
Steve Howell
70bc932913 Add test_html_tag_tree(). 2016-08-08 15:20:29 -07:00
Steve Howell
65147e7368 Add tests for template_parser.tokenize. 2016-08-08 15:20:29 -07:00
Steve Howell
184e45b774 Fix bug with tools/html-grep.
We were ignoring singleton tags like "input" tags in
html-grep.  This was an artifact of our tokenizer originally
being built to check indentation of templates, for which
singleton tags had been a distraction. This fix actually cleans up
the template checking logic as well, since it can now rely
on the tokenizer to classify special tags and singleton tags.
The tokenizer is more complete and more specific.
2016-08-08 15:20:29 -07:00
Umair Khan
acd76eb604 Annotate push_notifications.py. 2016-08-08 15:17:02 -07:00
Umair Khan
9c13e9a072 Annotate test_push_notifications. 2016-08-08 15:17:02 -07:00
Umair Khan
35dd1ffb13 Pass password as string to authenticate. 2016-08-08 15:17:01 -07:00
Umair Khan
266c791e64 Email should be a unicode. 2016-08-08 15:17:01 -07:00
Umair Khan
503ad774f5 Tokens should be unicode. 2016-08-08 15:17:01 -07:00
Umair Khan
4bc4c39528 Add *args and **kwargs to functions.
Arguments are added to:
    - SocialAuthMixin.get_email_address
    - SocialAuthMixin.get_full_name
2016-08-08 15:15:29 -07:00
Umair Khan
0dd7d0dda1 push_notifications: Change name to 'identifier'. 2016-08-08 15:15:29 -07:00
Umair Khan
fdbd132ba4 Annotate zerver/context_processors.py. 2016-08-08 15:15:29 -07:00
Umair Khan
00eab4e526 Annotate zerver/views/__init__.py. 2016-08-08 15:15:29 -07:00
Umair Khan
25dd1aeb5c Annotate zerver/lib/actions.py. 2016-08-08 15:13:29 -07:00
Umair Khan
ef62506fb1 Annotate zerver/models.py. 2016-08-08 15:13:29 -07:00
Umair Khan
e34b7a0691 Fix type annotation in message_cache_items. 2016-08-08 15:13:29 -07:00
Umair Khan
a3fd1b5d11 Annotate jinja2/__init__.py. 2016-08-08 15:12:12 -07:00
Umair Khan
ec910d96fc Annotate zerver/storage.py. 2016-08-08 15:12:12 -07:00
Umair Khan
0dfc757447 Annotate test_auth_backends.py. 2016-08-08 15:12:12 -07:00
Umair Khan
1259bc3057 Annotate jinja2/compressors.py. 2016-08-08 15:12:12 -07:00
Tim Abbott
6264ff7039 Add new Zulip realm import/export tool.
The previous export tool would only work properly for small realms,
and was missing a number of important features:
* Export of avatars and uploads from S3
* Export of presence data, activity data, etc.
* Faithful export/import of timestamps
* Parallel export of messages
* Not OOM killing for large realms

The new tool runs as a pair of documented management commands, and
solves all of those problems.

Also we add a new management command for exporting the data of an
individual user.
2016-08-08 14:58:18 -07:00
Tim Abbott
e7adaf8db1 utils: Add mkdir_p implementation. 2016-08-08 14:36:50 -07:00
Tim Abbott
b3a768f4b2 settings: Improve ALLOWED_HOSTS defaults logic and docs.
This removes the requirement for the user to put localhost/127.0.0.1
in their ALLOWED_HOSTS list, since it is now added automatically.

Fixes: #1358.
2016-08-05 21:25:29 -07:00
Tim Abbott
54a6bdc3ad views: Fix mypy annotations in get_invitee_emails_set.
Apparently this buggy annotation slipped through into master.
2016-08-05 15:04:16 -07:00
Tomasz Kolek
192f0f93e2 Change post-invite success message in case when user invites only one user.
Fixes: #1412.
2016-08-05 14:48:10 -07:00
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
Alexander Trost
8d4896809a Deduplication of configuration: Database Initialization
Comment tweaked slightly by tabbott.
2016-08-05 13:33:22 -07:00
Tim Abbott
5bff72c385 Revert "Use apt-add-repository to setup Zulip PPA."
This reverts commit 3f95e567c1.

Apparently `apt-add-repository` fails periodically in CI.  I suspect
this is some sort of silly networking problem, but given that all
we're saving is a few lines of code, the old version was better if
this fails basically ever.
2016-08-05 13:29:17 -07:00
Taranjeet Singh
ba4b06c6de gitignore: Remove tools/phantomjs.
This is now installed under /srv/phantomjs.
2016-08-05 13:28:52 -07:00
Taranjeet Singh
11598484ef gitignore: Remove zerver/fixtures/test_data1.json.
This file seems to no longer exist.
2016-08-05 13:28:43 -07:00
Tim Abbott
b9208affdb Remove event_log from .gitignore.
This was moved to the var/log/ subtree some time ago.
2016-08-05 11:12:23 -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