Steve Howell
d6c47573b2
Eliminate ZulipTestCase.send_message().
...
Now all tests use these three messages instead:
send_stream_message
send_personal_message
send_huddle_message
2017-10-28 10:20:59 -07:00
Greg Price
6d403ff255
tests: Simplify set_http_host to dedupe its logic.
...
This will make it easier to change this logic.
2017-10-27 14:42:24 -07:00
Steve Howell
4b78f69a87
tests: Introduce send_huddle_message().
...
The tighter interface here makes for shorter lines (or
fewer multi-line calls) and it leads to stricter type
checking.
2017-10-27 11:00:23 -07:00
Steve Howell
9707767b21
tests: Introduce send_personal_message().
...
The tighter interface prevents the need to specify
Recipient.PERSONAL (which can often be inaccurate in the
huddle case, anyway), and it prevents tests from confusingly
specifying a "subject" field for PMs.
2017-10-27 11:00:23 -07:00
Steve Howell
25a6fbd05d
tests: Introduce send_stream_message().
...
Having send_stream_message() avoids the need to supply
Recipient.STREAM as a parameter, and it also uses the more
modern name of `topic_name` for topics. Under the hood, it
avoids some annoying steps for re-formatting the recipients,
since we just have a single stream name.
2017-10-27 11:00:23 -07:00
derAnfaenger
e041abd300
tests: Add create_test_bot() helper function.
2017-10-25 15:46:07 -07:00
Tim Abbott
85917a7269
subdomains: Improve support for using the root domain.
...
This modifies the realm creation form to (1) support a
realm_in_root_domain flag and (2) clearly check whether the root
domain is available inside check_subdomain_available before trying to
create a realm with it; this should avoid IntegrityErrors.
2017-10-18 23:38:55 -07:00
Tim Abbott
2604eb0a07
test_classes: Refactor submit_reg_form_for_user.
...
This is a pure refactor in preparation for adding another argument.
2017-10-18 23:30:51 -07:00
derAnfaenger
5ddc336844
tests: Add welcome bot as user.
2017-10-11 20:45:42 -07:00
Steve Howell
9202777d7f
tests: Provide more useful output in assert_length().
2017-10-06 14:30:30 -07:00
rht
035ed93111
zerver/lib: remove import six.
2017-09-27 19:10:28 -07:00
rht
2e12fe5e2e
zerver/lib: Remove print_function.
2017-09-27 18:05:45 -07:00
Tim Abbott
c3911e3fb6
test_classes: Improve error handling for send_message.
2017-09-27 15:55:29 -07:00
rht
f43e54d352
zerver/lib: Remove absolute_import.
2017-09-27 10:00:39 -07:00
Robert Hönig
c77b245944
backend tests: Add 'AARON' as bot owner of OUTGOING_WEBHOOK_BOT.
2017-09-26 16:11:27 -07:00
Tim Abbott
c5d699b6fb
tests_classes: Add DEFAULT_SUBDOMAIN feature.
...
This should make life a little easier for those tests that need to use
the same subdomain like 20 times.
2017-08-28 23:17:33 -07:00
Tim Abbott
4a22316d90
test_decorator: Add explicit subdomains in tests.
2017-08-28 22:51:57 -07:00
Tim Abbott
a8b9ffc020
test_classes: Include more detail in incorrect JSON responses.
...
If the status code is wrong, we show the actual error message now,
which often saves a bit of time when debugging.
2017-08-28 21:43:41 -07:00
Tim Abbott
27101ae931
trello: Use client_head wrapper in tests.
2017-08-26 13:45:27 -07:00
Tim Abbott
d18f389bb5
test_messages: Set subdomain explicitly in most tests.
2017-08-26 13:45:27 -07:00
rht
e2e56a3e71
test_subs: Fix dict unpacking.
2017-08-26 09:01:10 -07:00
Tim Abbott
edc095db6d
test_subs: Explicitly declare subdomains.
2017-08-25 16:09:51 -07:00
Tim Abbott
7a5eb9dd9f
tornado: Add support for testing with subdomains.
2017-08-25 15:42:58 -07:00
Tim Abbott
43cfe73908
tests: Make requests use the "zulip" subdomain by default.
...
Previously, we didn't pass customized HTTP_HOST headers when making
network requests. As we move towards a world where everything is on a
subdomain, we'll want to start doing that.
The vast majority of our test code is written to interact with the
default "zulip" realm, which has a subdomain of "zulip". While
probably longer-term, we'll wish this was the root domain, for now, we
need to make our HTTP requests match what is expected by the test
code.
This commit almost certainly introduces some weird bugs where code was
expecting a different subdomain but the tests doesn't fail yet. It's
not clear how to find all of these, but I've done some grepping.
2017-08-25 15:42:49 -07:00
Tim Abbott
b0c8404622
tests: Add subdomain option to client_get and friends.
...
This should help make it easy to set the domain explicitly in tests
where that's important.
2017-08-25 15:42:42 -07:00
Tim Abbott
4229faf36e
tests: Remove old six.PY2 code paths.
2017-08-25 11:05:16 -07:00
Tim Abbott
50defd9b70
test_classes: Remove some unnecessary functions.
2017-08-24 23:33:12 -07:00
Tim Abbott
7d08ff69f0
tests: Remove most references to get_api_key.
...
This test helper doesn't really have value.
2017-08-24 23:30:46 -07:00
Tim Abbott
59aae22f99
registration: Fix find_my_team handling of unusual users.
2017-08-24 23:17:08 -07:00
Tim Abbott
e915fa058a
test_classes: Stop using get_realm_by_email_domain.
...
get_realm_by_email_domain was intended to be registration flow code
not used in other code, but it was leaked to a few places. This
removes one of the main remaining references to it outside the
registration code path.
2017-08-24 21:38:02 -07:00
Tim Abbott
95ed00bade
tests: Remove now-unused subscribe_to_stream helper.
2017-08-24 21:38:02 -07:00
Tim Abbott
69059dcac8
tests: Clean up subscribing from webhook tests.
2017-08-24 21:37:57 -07:00
Tim Abbott
5fa7c3e0b2
test_classes: Clean up API for unsubscribing.
...
The old API required test authors to unnecessarily repeat themselves.
2017-08-24 21:37:57 -07:00
Tim Abbott
eb720485c5
tests: Add and use new self.subscribe.
...
This new method cleans up the API for subscribing to something from a
test case.
2017-08-24 21:37:57 -07:00
Umair Khan
abed403a81
result.json: Upgrade test_classes.
2017-08-17 09:03:35 -07:00
Jack Zhang
e915321f89
registration: Remove organization type selection in realm creation.
2017-07-21 13:09:06 -07:00
Tim Abbott
6ac9bae5f5
bulk_add_subscriptions: Clarify name of from_stream_creation arg.
...
The old name was ambigious for whether it was about user or stream
creation.
2017-07-17 17:23:41 -07:00
Vishnu Ks
098569ccb4
test_classes: Use get_user in unsubscribe_from_stream.
2017-07-13 14:13:03 -07:00
Vishnu Ks
99e78cbead
test_classes: Use get_user in get_streams function.
2017-07-13 14:13:03 -07:00
Vishnu Ks
bf729c9a4d
test_classes: Use get_user in notification_bot fcuntion.
2017-07-13 00:45:24 +05:30
Vishnu Ks
f28b29177b
test_classes: Use get_user in mit_user function.
2017-07-13 00:45:24 +05:30
Vishnu Ks
0b701b52df
test_classes: Use get_user in example_user function.
2017-07-13 00:45:24 +05:30
Vishnu Ks
c5f75a8f3d
test_classes: Remove client_put_multipart function.
...
We are no longer using this method anywhere. Removing this
is essential for making the backend coverage tests to pass.
2017-07-07 10:31:43 -07:00
Rishi Gupta
36cd122905
models: Change default org_type to CORPORATE.
...
Once we implement org_type-specific features, it'll be easy to change a
corporate realm to a community realm, but hard to go the other way. The main
difference (the main thing that makes migrating from a community realm to a
corporate realm hard) is that you'd have to make everyone sign another terms
of service.
2017-06-29 15:14:58 -07:00
Tim Abbott
6aaca44e17
tests: Fix str/Text mypy issues in various tests.
2017-05-24 15:19:38 -07:00
Rick Chern
e53d1c3885
tests: Remove get_user_profile_by_email from most tests.
2017-05-24 13:05:19 -07:00
umkay
ccc70445d6
mypy: Fix strict-optional errors for test files.
...
Fix mypy --strict-optional errors in zerver/tests
2017-05-24 12:43:28 -07:00
Vishnu Ks
f5d8e256aa
Add ZulipTestCase.example_email and ZulipTestCase.mit_email function.
2017-05-23 15:27:21 -07:00
Vishnu Ks
7f06a7fa2a
Add ZulipTestCase.mit_user() function.
2017-05-22 19:02:42 -07:00
Aditya Bansal
26ff19f005
pep8: Add compliance with rule E261 to zerver/lib/test_classes.py.
2017-05-18 03:00:32 +05:30