Commit Graph

41 Commits

Author SHA1 Message Date
Rishi Gupta db0e509422 do_create_realm: Replace domain argument with string_id.
Turns string_id into a required argument, and domain into an optional
argument.
2016-11-02 22:46:34 -07:00
Umair Khan 0eff88ec2d Test registration of mirror dummy user.
Tweaked by tabbott to do the from_confirmation=1 call.
2016-11-02 18:17:29 -07:00
Umair Khan dd0c4ca0bc Test registration using POPULATE_PROFILE_VIA_LDAP. 2016-11-02 17:50:40 -07:00
Umair Khan 99f4174894 Test special registation link for completely open realms. 2016-11-02 17:50:39 -07:00
Umair Khan 8ff2cd3fd7 Only allow proper url for registration.
This commit fixes a bug which occurs when a user tries to bypass the
correct registration url for the completely open domains.
2016-11-02 17:49:30 -07:00
Steve Howell 7111bb1744 Deprecate /json/streams.
Note that we still need the equivalent function in our
user-facing API, so there is not much code removal yet.
(Also, we will probably always keep this in our API,
as bot authors will usually just want a simple endpoint
here, whereas our client code gets page_params and events.)
2016-10-28 13:44:46 -07:00
Rishi Gupta 537ee75761 Create RealmAlias entries for Realm.domain.
This is a preliminary step towards eliminating the realm.domain field
in favor of realm.subdomain.  Includes a database migration to create
these for existing realms.
2016-10-25 10:06:39 -07:00
Steve Howell 2a739318b9 Use make_stream() in test_signup.py. 2016-10-22 18:09:34 -07:00
Amy Liu 3ee777a11a Add UI for deactivating your own Zulip account.
Fixes #1009.
2016-10-20 22:29:30 -07:00
Steve Howell 45790264c2 Replace do_add_subscription() in test_signup. 2016-10-20 22:05:19 -07:00
Tim Abbott 3ee9e2c45f tests: Add some basic i18n public URL tests. 2016-10-16 11:26:01 -07:00
Tim Abbott dd352dd456 views: Move invitation views to their own file. 2016-10-11 21:27:06 -07:00
Rishi Gupta d75731f988 Realm creation flow: Remove invite page.
Previously, we sent users to an "invite your friends" page after they
created an organization. This commit removes that step in the flow and sends
users directly to the home page. We also remove the now-unused
initial_invite_page.html template, initial_invite.js (which pre-filled the
invite emails with characters from literature), and the /invite URL route.
2016-10-11 15:54:05 -07:00
Rishi Gupta 777fcaa6a0 Add new organization type field to Realm objects.
Adds a new field org_type to Realm.  Defaults for restricted_to_domain
and invite_required are now controlled by org_type at time of realm
creation (see zerver.lib.actions.do_create_realm), rather than at the
database level.  Note that the backend defaults are all
org_type=corporate, since that matches the current assumptions in the
codebase, whereas the frontend default is org_type=community, since if
a user isn't sure they probably want community.

Since we will likely in the future enable/disable various
administrative features based on whether an organization is corporate
or community, we discuss those issues in the realm creation form.
Before we actually implement any such features, we'll want to make
sure users understand what type of organization they are a member of.

Choice of org_type (via radio button) has been added to the realm
creation flow and the realm creation management command, and the
open-realm option removed.

The database defaults have not been changed, which allows our testing code
to work unchanged.

[includes some HTML/CSS work by Brock Whittaker to make it look nice]
2016-10-05 17:01:46 -07:00
Steve Howell 69fa60080c tests: Test get_prereg_user_by_email(). 2016-10-04 10:35:43 -07:00
Rishi Gupta 48bec80c61 Fix test_signup.LoginTest.test_register.
The test currently expects 67 database queries during registration, but we
added two more (likely calls to resolve_subdomain_to_realm) in ea39fb2.
2016-10-02 19:16:24 -07:00
hackerkid ea39fb2556 Add option for hosting each realm on its own subdomain.
This adds support for running a Zulip production server with each
realm on its own unique subdomain, e.g. https://realm_name.example.com.

This patch includes a ton of important features:
* Configuring the Zulip sesion middleware to issue cookier correctly
  for the subdomains case.
* Throwing an error if the user tries to visit an invalid subdomain.
* Runs a portion of the Casper tests with REALMS_HAVE_SUBDOMAINS
  enabled to test the subdomain signup process.
* Updating our integrations documentation to refer to the current subdomain.
* Enforces that users can only login to the subdomain of their realm
  (but does not restrict the API; that will be tightened in a future commit).

Note that toggling settings.REALMS_HAVE_SUBDOMAINS on a live server is
not supported without manual intervention (the main problem will be
adding "subdomain" values for all the existing realms).

[substantially modified by tabbott as part of merging]
2016-09-27 23:24:14 -07:00
Tim Abbott 03bf8893e2 Remove legacy /api/v1/send_message endpoint.
This was the original way to send messages via the Zulip API in the
very early days of Zulip, but was replaced by the REST API back in
2013.

Fixes: #730.
2016-09-27 14:51:54 -07:00
Supriya 4959e8d10a tests: Extract and use assert_max_length test helper.
This makes it much more explicit in which cases we're checking
equality or a maximum in our use of `assert_length`.

Fixes #1400.
2016-09-25 15:44:58 -07:00
Rishi Gupta 03ce3e5fa4 test_signup.py: Refactor getting confirmation_urls to test_helpers.py
It is a bit of tricky / scary looking code that was repeated several times
in test_signup.
2016-09-23 15:44:28 -07:00
umkay cd1908d04d Add test for password reset flow. 2016-09-13 18:16:50 -07:00
Tim Abbott 3a64074e8b test_signup: Annotate some recently added functions. 2016-09-10 11:57:07 -07:00
Steve Howell fd6ee7117f tests: Renamed AuthedTestCase to ZulipTestCase. 2016-08-22 19:07:44 -07:00
Rag Sagar 2fef36f15a Add realm-level default language setting.
Adds a new field default language in the zerver_realm model.
This realm level default language will be used as default language
for newly created users. Realm level default language can be
changed from the administration page.

Fixes #1372.
2016-08-09 17:38:29 -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
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
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
Eklavya Sharma e28b038f1d Use assert_in_response by fixing line-wrapping in templates. 2016-07-12 17:52:47 -07:00
Eklavya Sharma c98c3d5f8d Re-enable some backend tests on python 3. 2016-07-12 14:06:29 -07:00
Eklavya Sharma d740a87d04 zerver/tests: Use unicode strings.
* Use unicode strings for strings containing non-ASCII characters.
* Decode response content when text output is expected.
2016-07-12 14:06:29 -07:00
Eklavya Sharma 73a3c9fa47 On python 3, skip expected failures in backend tests. 2016-07-12 09:27:55 -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
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
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
Tim Abbott 27e9d3f06b Annotate test_external and test_signup. 2016-06-04 11:53:20 -07:00
Rachel Kelly df36216914 Change instances of 'coworkers' to 'users'.
In order to genericize use of Zulip outside companies,
    all instances of coworkers have been changed to users.
    NOTABLE EXCEPTION: When the Zulip instance is domain-
    locked, the reference to coworkers remains.  The reason
    for this is twofold: first, the majority of Zulip instances
    which require a particular domain will be locked to a
    company, and second, the template variable for the domain
    necessary should be added to the alert so it is clear
    to the user what the domain needs to be for access.

Fixes: #861.
2016-06-02 16:05:27 -07:00
Ashish Kumar 48be2e33f8 Delete old route for /json/get_public_streams. 2016-04-29 12:57:57 -07:00
Ashish Kumar b5ab4d45f9 Replace /json/get_public_streams with REST style route. 2016-04-29 12:57:57 -07:00
Tim Abbott be96cf809d Move Zulip backend tests to zerver.tests. 2016-04-11 22:16:09 -07:00