Commit Graph

12408 Commits

Author SHA1 Message Date
Eklavya Sharma 2d3921e3e4 Add instructions for manually installing pgroonga. 2016-09-17 09:23:54 -07:00
Steve Howell 750720116f tests: Add test_update_realm_api(). 2016-09-17 08:31:23 -07:00
Umair Khan ff0f413d26 Use npm caching in upgrade-zulip-stage-2. 2016-09-16 12:40:48 -07:00
Umair Khan 4301d11b4a Use npm caching in tools/update-prod-static. 2016-09-16 12:40:48 -07:00
Umair Khan a82990f63c Use npm caching in tools/provision.py. 2016-09-16 12:40:48 -07:00
Umair Khan ec74974de3 Create node_cache module for npm caching. 2016-09-16 12:40:48 -07:00
Tim Abbott 2c19719cee test_bugdown: Fix i18n test flakiness with markdown rendering tests.
It appears that the assertRaisesRegexp approach we had before didn't
work properly on some systems, likely due to a bad interact with a
i18n (we haven't definitively determined the cause).
2016-09-16 11:49:52 -07:00
Steve Howell a036a72db6 bugdown: Raise BugdownRenderingException.
We now raise an exception in bugdown.do_convert() if rendering
fails, to avoid silent failures, and then calling code can convert
the exception to a JsonableError.
2016-09-16 10:01:55 -07:00
Steve Howell de25f07961 tests: Add BugdownErrorTests. 2016-09-16 10:01:55 -07:00
Steve Howell 152cebf33d bugdown: Extract log_bugdown_error().
(It makes it easier to mock out the logging.)
2016-09-16 10:01:54 -07:00
Steve Howell c4dd3ba0d3 tests: Add test_illegal_name_changes(). 2016-09-16 09:59:26 -07:00
Steve Howell ac0a11f098 tests: Add test_report.py.
This is close to 100% coverage, but the js_source_map stuff will be
tricky, and we may just want to eliminate that soon.
2016-09-16 07:01:40 -07:00
Steve Howell 6ecee2ac4f streams: Simplify list_to_streams().
The list_to_streams() method now uses create_streams_if_needed() to
do its heavy lifting during the autocreate=True case.

This commit gets us to 100% coverage on the streams view.  (The
recently created action.create_streams_if_needed() was easy
to test in isolation, and it has 100% coverage as well, so we are
not cheating here.)

Fixes: #1005.
2016-09-15 10:18:10 -07:00
Steve Howell 8776cc0e35 Add create_streams_if_needed(). 2016-09-15 10:18:10 -07:00
Steve Howell e8119b175d tests: Add test_tutorial.py. 2016-09-15 10:15:18 -07:00
Steve Howell a9e2ceb4e9 push notifications: Fix very minor quirk when adding tokens.
When we push a device token, we want to clean out any other user's
tokens on the device, but not the current user's.  We were wiping
away our own token, if it existed, before creating it again.  This
was probably never a user-facing problem; it just made for dead code
and a little unnecessary DB churn.  By excluding the current user
from the delete() call, we exercise the update path in our tests now,
so we have 100% coverage.
2016-09-15 06:40:18 -07:00
Steve Howell f9cdc63250 tests: Add test_push_api().
We now have 100% coverage on views/push_notifications.py, modulo
some dead code which will be addressed in the next commit.

There were some existing tests in text_external.py, but that
module is really intended for tests that hit external services.

The view is a really simple API that updates a DB table, and the
new test code focuses on error handling and idempotency as well
as the happy path.
2016-09-15 06:39:41 -07:00
Tim Abbott 5fcc8146c1 emoji_dump: Clean up spammy sprite creation output.
Glue apparently prints 1 line per file being processed.
2016-09-14 11:49:55 -07:00
sonali0901 15331ad9fa docs: Document invite-only streams are hidden from other users.
Fixes: #1756.
2016-09-14 10:06:10 -07:00
Tim Abbott 0f4bbc8617 portico: Add options to disable login and about links.
This gives us a great deal more flexibility for controlling the
context of the portico footer.
2016-09-13 22:59:09 -07:00
Rishi Gupta de11e7c1b3 Add support for subdomain URIs to /api and /api/endpoints.
To the extent possible, we share code with the already-existing
IntegrationView code path.
2016-09-13 22:31:56 -07:00
Tim Abbott bc827b2a6f integrations: Add test for integrations context. 2016-09-13 22:31:55 -07:00
Tim Abbott f9e41b1387 integrations: Factor out ApiURLView base class. 2016-09-13 22:26:47 -07:00
Tim Abbott b7ab83c6ec Move api_endpoint_docs to integrations views file. 2016-09-13 21:58:02 -07:00
Tomasz Kolek acbfe7e624 Add Librato integration.
Fixes: #68.
2016-09-13 21:55:25 -07:00
umkay 6d4f86f951 Add explanation for test_mit_rendering. 2016-09-13 21:23:57 -07:00
umkay 7eb6924841 Wrap dict view object in list for python3 compatibility.
Deleting items from a dictionary being iterated through directly
doesn't work properly in Python 3.
2016-09-13 21:21:45 -07:00
Tim Abbott 6c617910c3 Add an app-internal about page for the project.
We will want to link to this from at least the portico.
2016-09-13 21:10:07 -07:00
umkay cd1908d04d Add test for password reset flow. 2016-09-13 18:16:50 -07:00
Tim Abbott e93a2e990f Fix nondeterministic parsing failures in GoogleLoginTest.
Apparently, in urllib.parse, one need to extract the query string from
the rest of the URL before parsing the query string, otherwise the
very first query parameter will have rest of the URL in its name.

This results in a nondeterministic failure that happens 1/N of the
time, where N is the number of fields marshalled from a dictionary
into the query string.
2016-09-13 18:13:28 -07:00
Tim Abbott ca91605e85 Extract zerver/views/pointer.py. 2016-09-13 17:30:39 -07:00
Tim Abbott 29495b953a Add test for GET /json/users/me/pointer. 2016-09-13 17:30:39 -07:00
Tim Abbott 6d8af06e32 Fix Google oauth2 logging to use %s for strings.
This has more consistent results in Python 2 vs. Python 3.
2016-09-13 17:30:39 -07:00
Tim Abbott 95a348382b Fix nondeterministic failures in GoogleLoginTest. 2016-09-13 17:26:38 -07:00
Tim Abbott 8fe7488074 views: Remove extract_json_response hack for python-requests.
Now that we are using a virtualenv for dependencies, we can be
confident we will never be using an old system-installed version of
this library.
2016-09-13 17:08:14 -07:00
Tim Abbott b8bdf1365b tests: Add a Google web authentication test suite. 2016-09-13 17:08:14 -07:00
Tim Abbott 97dbf1a8f9 Refactor Google auth error handling to be more testable. 2016-09-13 17:08:14 -07:00
Tim Abbott 9bfe879170 google auth: Fix py3 encoding issues for CSRF computations. 2016-09-13 17:08:14 -07:00
Tim Abbott 4a2282a837 tests.py: Fix missing import needed for mypy. 2016-09-13 17:08:14 -07:00
Steve Howell 51c78571cc tests: Add HomeTest.test_invites_by_admins_only(). 2016-09-13 16:46:05 -07:00
Steve Howell 7cb8f6421d tests: Add HomeTest.test_new_stream(). 2016-09-13 16:46:05 -07:00
Steve Howell eced842f4d tests: Add HomeTest.test_notifications_stream(). 2016-09-13 16:46:05 -07:00
Steve Howell cad12b077f tests: Extract HomeTest._get_page_params(). 2016-09-13 16:46:05 -07:00
Steve Howell 1091b51bb4 tests: Add HomeTest.test_bad_pointer(). 2016-09-13 16:46:05 -07:00
Steve Howell 7f771c64ae tests: Add HomeTest.test_bad_narrow(). 2016-09-13 16:46:05 -07:00
Steve Howell 2bf876d5bb tests: Add HomeTest._sanity_check(). 2016-09-13 16:46:05 -07:00
Steve Howell dc2dde1509 tests: Add HomeTest.test_terms_of_service(). 2016-09-13 16:46:05 -07:00
Steve Howell fa4110b1d9 tests: Extract HomeTest._get_home_page(). 2016-09-13 16:46:05 -07:00
Steve Howell f5f7801302 tests: Extract test_presence.py 2016-09-13 14:51:36 -07:00
Steve Howell 2b4d59d6e8 Fix comment in update_active_status_backend(). 2016-09-13 14:45:27 -07:00