Commit Graph

1119 Commits

Author SHA1 Message Date
Steve Howell f18cc4ae3a export: Added export_avatars_local_helper(). 2016-08-09 15:58:27 -07:00
Umair Khan acd76eb604 Annotate push_notifications.py. 2016-08-08 15:17:02 -07:00
Umair Khan 0dd7d0dda1 push_notifications: Change name to 'identifier'. 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 e34b7a0691 Fix type annotation in message_cache_items. 2016-08-08 15:13:29 -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
Umair Khan d33fc0046f Add APNS feedback server 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 882bb5558b Push to APNS in a loop. 2016-08-05 10:36:57 -07:00
Umair Khan 4e8ca0a326 Make sure apns response code is an integer. 2016-08-05 10:36:57 -07:00
Umair Khan 5c41eae7ec Don't send connection to apns response listener. 2016-08-05 10:36:57 -07:00
Umair Khan ffaf7cb2ba Create get_connection function for APNS. 2016-08-05 10:36:57 -07:00
Umair Khan 1d2bdfdfb1 Save user id instead of user profile. 2016-08-05 10:36:57 -07:00
Umair Khan 0cac1aa135 For APNS frame identifier generate random int. 2016-08-05 10:36:57 -07:00
Umair Khan 0b5dc56b8d Redis key expiry should be an integer. 2016-08-05 10:36:57 -07:00
Umair Khan cbd53fbac8 Don't import OrderedDict. 2016-08-05 10:36:57 -07:00
Umair Khan 0b88deb640 APNS_SANDBOX should be a bool.
Fixes: #1480
2016-08-05 10:36:57 -07:00
Tim Abbott 2f13b0b18a actions: Fix various string annotations. 2016-08-04 15:57:03 -07:00
Tim Abbott d7d8d6b4d2 parallel: Add missing annotation. 2016-08-04 15:57:03 -07:00
Tim Abbott 5253c044e7 test_helpers: Add some missing annotations. 2016-08-04 15:57:03 -07:00
Tim Abbott 0689485666 Add lint check for malformed type annotations missing :.
Also fix the 2 annotations that weren't being checked because of this.
2016-08-04 15:53:23 -07:00
Tim Abbott 028efdcb78 integrations: Add detailed module docstrings. 2016-08-04 12:13:25 -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
Rishi Gupta 948ea7663c ModelReprMixin: Fix handling of missing __unicode__ function.
The old behavior was to raise an exception, but Django was catching
the exception and doing unexpected things. For instance, in the
manage.py shell, printing out a ModelReprMixin object (with
__unicode__ not implemented) would result in nothing being printed,
rather than it raising a error or otherwise alerting the programmer as
to what was going on.
2016-08-02 11:46:01 -07:00
Umair Khan 2c07f1b19a Use NOREPLY_EMAIL_ADDRESS if email gateway not enabled.
This fixes a regression where missed message emails would not be sent
at all in the event that EMAIL_GATEWAY_PATTERN was unset.

The overall experience still isn't great, but it's better than crashing.

Fixes: #1411

[commit message expanded by tabbott]
2016-07-31 20:38:18 -07:00
Steve Howell 2a37dafcbb Write untested_url_report.txt. 2016-07-29 21:26:51 -07:00
Steve Howell 8b13530712 Add tools/analyze-url-coverage 2016-07-29 21:23:33 -07:00
Steve Howell 21f83afe3a Add --url-coverage option to ./tools/test-backend. 2016-07-29 21:23:33 -07:00
Steve Howell 9fb071947d Remove expected_run_time from @slow test decorator. 2016-07-29 16:41:21 -07:00
Steve Howell 438a118ea5 Simplify enforce_timely_test_completion().
This will lead to minor differences in the warnings that
people see when they run tests that are slow.  We call out
the slowness a little more clearly from a visual standpoint,
and we simplify the calculation of the slowness threshold.

We still allow more time for tests with the `@slow` decorator
to run, but we don't use their expected_run_time.
2016-07-29 16:41:21 -07:00
Steve Howell 4556bf528f Add --report-slow-tests option to tools/test-backend. 2016-07-29 16:41:20 -07:00
Umair Khan 8e5e6a06f2 Delete cache entry for user profile.
Our flush functions update user profile cache entries which can cause
confusing race conditions (see e.g. #1257).  To resolve this, we move
all the user_profile flush functions to delete the entry instead of
updating it -- it will then be fetched as part of the next request
that needs to access the user object.

There are still races here, and there is perhaps an argument that a
better fix for this would be to re-fetch the object and then put it
into the cache, but this resolves the main cache correctness problem
we had with the previous implementation.

Fixes: #1322.
2016-07-28 13:43:14 -07:00
Steve Howell 713797a65c Add lint checks for self.client.{get,patch,put,post,delete}. 2016-07-27 20:50:54 -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 4267dcbb68 Change the way referred attachments are removed on message update.
This fixes incorrect behavior when two or more attachments are removed
in the same message.
2016-07-27 14:08:59 -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
Tim Abbott 884f50cdd7 validate_user_access: Assert user_profile is not None.
This function is only called in cases where user_profile isn't None,
and the code reads better if we just check that first rather than
checking it on every line that accesses user_profile.
2016-07-26 20:30:12 -07:00
Tim Abbott d1adbd798b get_subscribers_to_streams: Pass through requesting_user. 2016-07-26 20:30:12 -07:00
Tim Abbott 691ad7fcfc maybe_get_subscriber_emails: Pass user_profile through. 2016-07-26 20:30:12 -07:00
Tim Abbott f790a04102 Remove unused get_subscriber_ids. 2016-07-26 20:30:12 -07:00
Tim Abbott 1771b8275c Remove unused get_other_subscriber_ids. 2016-07-26 20:30:12 -07:00
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
rahuldeve e06d5fbec9 Pass Message object instead of message dict to do_claim_attachments. 2016-07-25 17:54:36 -07:00
rahuldeve c61d149837 Pass Message object instead of message dict to claim_attachment. 2016-07-25 17:51:17 -07:00
Eklavya Sharma 5b06edc402 zerver/lib/type_debug.py: Handle container types better. 2016-07-23 14:35:39 -07:00
Eklavya Sharma a632c71cce Add zerver/lib/type_debug.py.
This file has a decorator print_types, which makes the decorated
function print the types of its arguments whenever it is called.
2016-07-23 14:35:39 -07:00
Tim Abbott eba2d470dc Fix removing attachments when editing a message.
Fixes #1373.
2016-07-22 14:48:47 -07:00
Eklavya Sharma 674f6999e1 Improve annotations of decorators. 2016-07-22 11:14:33 -07:00
Eklavya Sharma 07e36d87a2 Remove return where no return value is expected.
zerver.lib.notifications.send_future_email has return type None.
So replace `return send_future_email(...` by `send_future_email(...`.
2016-07-22 11:14:33 -07:00
Krit Karan a61ef3bc0e Reformat the content variable in ``do_refer_friend()``.
Fixes #1162.
2016-07-22 10:36:35 -07:00
Eklavya Sharma c59740385d zerver/lib/str_utils.py: Replace ValueError by TypeError.
When a parameter of a wrong type is passed to a `force_*` method
in str_utils.py, raise a TypeError.
2016-07-21 23:14:00 +05:30
Tim Abbott c791037166 narrow: Document BuildNarrowFilterTest. 2016-07-20 14:18:40 -07:00
Tim Abbott e876f12b83 settings: Extract settings.WELCOME_EMAIL_SENDER. 2016-07-19 15:28:41 -07:00
Tim Abbott 7725c62892 Use VERBOSE_SUPPORT_OFFERS in day1 emails. 2016-07-19 15:28:41 -07:00
Tim Abbott 3ea4cbb5c3 settings: Extract settings.VERBOSE_SUPPORT_OFFERS. 2016-07-19 15:28:41 -07:00
Tim Abbott ff1faffecd settings: Extract EMAIL_GATEWAY_EXTRA_PATTERN_HACK. 2016-07-19 15:28:41 -07:00
Tim Abbott afaac85dc6 Move get_sqlalchemy_connection to its own file. 2016-07-19 15:28:41 -07:00
Kartik Maji 599b15cb84 Allow fetching subscribers for streams the user has never subscribed to.
This allows the frontend to fetch data on the subscribers list (etc.)
for streams where the user has never been subscribed, making it
possible to implement UI showing details like subscribe counts on the
subscriptions page.

This is likely a performance regression for very large teams with
large numbers of streams; we'll want to do some testing to determine
the impact (and thus whether we should make this feature only fully
enabled for larger realms).
2016-07-18 16:24:19 -07:00
Taranjeet Singh 9f3f82d06d zerver/lib/socket.py: Fix line with length greater than 120. 2016-07-18 14:42:39 -07:00
Tim Abbott 014a13df7c cache: Fix echoing of mkdir command to console. 2016-07-18 14:25:13 -07:00
Taranjeet Singh ba3f9de9a9 zerver/lib/cache.py: Move remote_cache_prefix to var directory.
This commit ensures the var directory exists before its needed in both
development and production environments.
2016-07-18 14:13:02 -07:00
Eklavya Sharma c389d22b5f Fix twitter mock data. 2016-07-17 10:23:25 -07:00
Eklavya Sharma fb1d00fc6c Upgrade python-twitter to latest version.
Fixes #1145.
2016-07-17 10:23:25 -07:00
Eklavya Sharma 4130170da8 bugdown: Fix string handling.
Use unicode strings where needed and correctly encode/decode strings.
2016-07-17 10:23:25 -07:00
Eklavya Sharma abe7faa2f9 bugdown: Annotate some variables. 2016-07-17 10:23:25 -07:00
Steve Howell 60bd20da61 Remove zerver/lib/query.py (dead code). 2016-07-16 14:51:15 -07:00
Rishi Gupta 09754c9861 Remove JsonableErrors from actions.do_update_message.
There were a bunch of authorization and well-formedness checks in
zerver.lib.actions.do_update_message that I moved to
zerver.views.messages.update_message_backend.

Reason: by convention, functions in actions.py complete their actions;
error checking should be done outside the file when possible.

Fixes: #1150.
2016-07-15 13:55:49 -07:00
Rishi Gupta d529a94e4d Add realm setting to time-limit editing of message content.
This is controlled through the admin tab and a new field in the Realms table.
Notes:
* The admin tab setting takes a value in minutes, whereas the backend stores it
  in seconds.
* This setting is unused when allow_message_editing is false.
* There is some generosity in how the limit is enforced. For instance, if the
  user sees the hovering edit button, we ensure they have at least 5 seconds to
  click it, and if the user gets to the message edit form, we ensure they have
  at least 10 seconds to make the edit, by relaxing the limit.
* This commit also includes a countdown timer in the message edit form.

Resolves #903.
2016-07-15 13:55:49 -07:00
Eklavya Sharma 29673411df Make backend tests (hackishly) pass on python3.4.
Replace bot_owner=bot_owner by bot_owner_id=bot_owner.id while
creating a UserProfile object.
2016-07-15 11:13:33 -07:00
Steve Howell 9d7716f368 Add message.topic_name() helper function.
This little helper will facilitate adding a new Topic
table in the future.
2016-07-14 09:54:56 -07:00
Steve Howell 21fb7693d2 Add test_helpers.client_patch_multipart(). 2016-07-13 22:53:40 -07:00
Steve Howell 701bb7a59f Remove test_helpers.DummySession 2016-07-13 19:08:28 -07:00
Steve Howell 616e49e2e8 Remove test_helpers.DummyTornadoRequest 2016-07-13 19:08:28 -07:00
Steve Howell 0060ea7903 Remove test_helpers.DummyStream 2016-07-13 19:08:28 -07:00
Steve Howell 191ac80475 Remove callback logic from test_helpers.DummyHandler. 2016-07-13 19:08:28 -07:00
Eklavya Sharma 4f633bcd0b zerver/lib/notifications.py: Fix string encoding/decoding.
Correctly encode and decode strings in convert_html_to_markdown.
It wasn't possible to use universal_newlines=True since
Popen.communicate doesn't encode/decode strings correctly on
python 2.
2016-07-13 16:00:46 -07:00
Eklavya Sharma e6502710b6 Change exception.message to str(exception).
The 'message' attribute in Exception has been deprecated.
It has been removed in python 3.
2016-07-13 16:00:46 -07:00
Eklavya Sharma 993558c680 Get mogrified SQL queries as text.
zerver.lib.test_helpers.queries_captured returns a byte string,
while we want the queries to be text.  So decode the captured
queries.
2016-07-13 16:00:46 -07:00
Umair Khan 395e053ce3 Revert "Revert "Extract reply from email.""
This reverts commit f1ba3ded42.
2016-07-13 11:24:18 -07:00
Umair Khan f15dfc69fb Make code Python 3 compatible.
Make convert_html_to_markdown function Python 3 compatible.
2016-07-13 11:24:18 -07:00
Tim Abbott 34a251adb1 upload: Fix exception uploaded files with unknown content type.
It turns out our detected content_type can actually be None, which
meant calling force_text on it broke uploading some files.
2016-07-13 10:57:55 -07:00
Umair Khan 0aae0eab49 Switch to PyAPNS for sending push notifications.
Switch to [PyAPNS](https://github.com/djacobs/PyAPNs).

Fixes #538.
2016-07-13 10:55:07 -07:00
Tim Abbott 305189956b update_message_flags: Log number of messages updated. 2016-07-12 19:12:49 -07:00
Eklavya Sharma 161c27d0e9 Add methods to AuthedTestCase to test response content.
Add methods assert_equals_response and assert_in_response to
AuthedTestCase.  These methods make it convenient to check if
a string equals the contents of an HttpResponse's body or if a
string is a substring of the contents of an HttpResponse's body.
2016-07-12 14:06:29 -07:00
Eklavya Sharma 2080ff6c2a Decode response.content everywhere except in tests.
response.content is binary data, but code usually assumes it to
be text.  Fix this by decoding response.content where required.
Don't do this in tests yet.
2016-07-12 14:06:29 -07:00
Eklavya Sharma 4868cd9969 zerver/lib/test_helpers.py: Add skip_py3 decorator. 2016-07-12 09:27:55 -07:00
Eklavya Sharma 0a9c600c8b Show skipped tests in test runner. 2016-07-12 09:27:55 -07:00
Tim Abbott e21bc11cfd Extract attachment_url_to_path_id. 2016-07-10 18:07:37 -07:00
Tim Abbott 48ae178d0b Refactor attachment_url_re to be a common value in upload.py. 2016-07-10 18:04:58 -07:00
rahuldeve c5756e4fa4 Update attachment tracking on message update. 2016-07-10 18:01:59 -07:00
Tim Abbott 211a166abc message edit: Move new topic non-empty check to view. 2016-07-10 18:01:59 -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
Umair Khan 2d243c0703 get_all_templates should not return __init__.py. 2016-07-09 07:09:55 -07:00
Tim Abbott 1e2d38e790 Move stringify_message_dict into to_dict_uncached. 2016-07-08 17:58:56 -07:00
Tim Abbott 72e948d19a Remove now-unused message_cache_key message cache.
Originally this cache was used to transmit data from Django to Tornado
(and also for general message caching purposes), but now nothing
actually reads from this cache, so we can eliminate it.
2016-07-08 17:58:56 -07:00
Tim Abbott 8d5ec14b31 cache_helpers: Fill to_dict cache instead of old message cache.
Apparently, the message cache we were filling was completely useless
and unused, and furthermore, the cache we were filling as part of
restarting the server was also totally useless, since it didn't have
the messages users would be requesting.
2016-07-08 17:58:56 -07:00
Taranjeet a8a4caf2c0 zerver: Fix lines with length greater than 120. 2016-07-08 11:41:43 -07:00
Umair Khan f1f48f305e Extract reply from email. 2016-07-08 10:58:25 -07:00
Umair Khan 8538ba8ea8 Remove do_send_missedmessage_events function. 2016-07-08 10:58:25 -07:00
Umair Khan 06355105f5 Missed message emails should come from user email.
Fixes #448
FIxes #612
2016-07-08 10:58:25 -07:00
Eklavya Sharma 7956fcbf0d zerver/lib/str_utils.py: Allow specifying encoding. 2016-07-07 10:06:22 -07:00
Eklavya Sharma 628e45defc zerver/lib/actions.py: Use text_type in truncate_ functions.
The functions truncate_content, truncate_body and truncate_topic
are only meant to be used on text strings.  So change its
parameter types from AnyStr to text_type.
2016-07-07 10:02:08 -07:00
Eklavya Sharma 976858f536 tornado_ioloop_logging.py: Ignore because of missing stub.
There is no stub for select.epoll on python 3.  So ignore the
statement which uses it.
2016-07-07 10:02:08 -07:00
Eklavya Sharma 9d2a539aaa zerver/lib/notifications.py: Add hints for mypy.
Add type hints for mypy using isinstance in assert and if.
2016-07-07 10:02:08 -07:00
Tim Abbott 98db1d996f email_mirror: Fix some indentation issues. 2016-07-07 10:02:08 -07:00
Eklavya Sharma 5e81a4d93f zerver/lib/email_mirror.py: Improve annotation in python 3.
Add asserts and if statements to help mypy.
2016-07-07 10:01:30 -07:00
Eklavya Sharma 4f221c21a0 zerver/lib/email_mirror.py: Improve subject extraction.
Improve subject extraction in process_message.
2016-07-07 09:55:23 -07:00
Eklavya Sharma 06a7a6caee zerver/lib/debug.py: Remove from mypy's exclude_py3.
traceback.print_stack doesn't have a stub yet.  So ignore the
statement which uses it.
2016-07-07 09:52:24 -07:00
Eklavya Sharma 6bb266d262 bugdown's __init__.py: Add python 3 compatibility.
* Use Response.text instead of Response.content.
* Make unescaping work on python 3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma 05046d9288 bugdown's codehilite.py: Fix annotations in python 3 mode.
Many stubs in xml.etree.ElementTree use Union[str, bytes] as
return type.  Mypy wants us to correctly handle each case.  This
is correct, but not useful for us since we know that we'll always
get str.  So force the return value to text_type, to supress mypy
errors.
2016-07-07 09:52:24 -07:00
Eklavya Sharma 610f19c791 zerver/lib/camo.py: Type ignore statement with hex encode. 2016-07-07 09:52:24 -07:00
Eklavya Sharma 4e698ab1f6 Remove zerver/lib/parallel.py from mypy's exclude_py3. 2016-07-07 09:52:24 -07:00
Eklavya Sharma ce6ddd574a zerver/lib/test_helpers.py: Replace os.path.walk by os.walk.
os.path.walk has been removed in python 3.
2016-07-06 11:49:55 -07:00
Eklavya Sharma 6505cbf2bf zerver/lib/timeout.py: Replace isAlive by is_alive.
In threading.Thread, isAlive has been removed in python 3.
We should use is_alive instead.
2016-07-06 11:49:48 -07:00
Umair Khan 035fceb814 Add dynamically loaded language dropdown. 2016-07-04 11:56:02 -07:00
Conrad Dean bbf7a9c801 Annotate zerver/lib/event_queue.py. 2016-07-04 03:01:33 +05:30
Conrad Dean 9812e676f0 Annotate zerver/lib/queue.py. 2016-07-04 03:01:32 +05:30
Eklavya Sharma 192663edcf zerver/lib/narrow.py: Fix annotations. 2016-07-04 03:01:32 +05:30
Eklavya Sharma 95b6e668a7 zerver/lib/actions.py: Fix annotations.
Change queue_ids from text_type to str.
2016-07-04 03:01:32 +05:30
Eklavya Sharma 9772a512cb Use abstract types in annotations. 2016-07-04 03:01:32 +05:30
Eklavya Sharma de19b24f74 zerver/lib/handlers.py: Fix an annotation. 2016-07-04 02:20:25 +05:30
Eklavya Sharma b902c1ae45 bugdown: Replace raw unicode literal with non-raw.
Raw unicode literals are disallowed in python 3.
2016-07-02 10:38:48 -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
Alex Wilson 8c62cff1b7 bugdown: Clean up paths to emojis. 2016-06-30 15:48:02 -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
Eklavya Sharma def8cd8e78 Annotate zerver/lib/timeout.py. 2016-06-29 10:41:01 -07:00
Eklavya Sharma 21f789eb05 zerver/lib/session_user.py: Replace Dict by Mapping. 2016-06-29 10:36:50 -07:00
Eklavya Sharma b76dc9bf4e zerver/lib/upload.py: Fix string types. 2016-06-29 20:43:28 +05:30
Eklavya Sharma 2cba2caa7f zerver/lib/test_helpers.py: Fix string annotations. 2016-06-29 01:54:17 +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
Eklavya Sharma eb3bde40a0 zerver/lib/test_helpers.py: Improve type annotations. 2016-06-29 01:35:34 +05:30
Eklavya Sharma 97760702a8 zerver/lib/actions.py: Use Sequence as parameter type. 2016-06-29 01:11:41 +05:30
Eklavya Sharma dca9256f3c zerver/lib/socket.py: Improve annotations.
* Add Optional where required.
* Set type of req_redis_key as `(text_type) -> text_type` for consistency.
  Almost all our cache keys and redis keys use this signature.
2016-06-29 00:45:13 +05:30
Eklavya Sharma b305af05b3 Fix string annotations in custom cursors. 2016-06-28 15:58:57 +05:30
Eklavya Sharma 1a00b08a11 zerver/lib/db.py: Use a type alias to shorten annotations. 2016-06-28 15:57:43 +05:30
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
rahuldeve 2bf15603f3 Modify rest_dispatch to support method specific flags.
[simplified substantially by tabbott]
2016-06-27 10:53:15 -07:00
Eklavya Sharma f20699b615 zerver/lib/statistics.py: Fix annotations.
Add type annotation to a variable.
Use abstract base container types where suitable.
Add missing imports from typing.
2016-06-27 18:03:29 +05:30
Eklavya Sharma 3917b822e5 zerver/lib/bulk_create.py: Type annotate variables. 2016-06-27 17:52:37 +05:30
Eklavya Sharma 9aa6fd988a zerver/lib/actions.py: Type annotate variables. 2016-06-27 17:52:07 +05:30
Eklavya Sharma 7ca1e658b5 zerver/lib/cache.py: Change some TypeVars to Any.
Change ItemT and CompressedItemT to Any.
See https://github.com/python/mypy/issues/1721.
2016-06-27 16:50:50 +05:30
Tim Abbott ce7c7d3510 Wrap youtube_re. 2016-06-25 10:52:03 -07:00