forked from zulip/zulip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_events: Add a test for do_refer_friend.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
do_deactivate_stream, | ||
do_deactivate_user, | ||
do_reactivate_user, | ||
do_refer_friend, | ||
do_regenerate_api_key, | ||
do_remove_alert_words, | ||
do_remove_realm_emoji, | ||
|
@@ -577,6 +578,19 @@ def test_pointer_events(self): | |
error = schema_checker('events[0]', events[0]) | ||
self.assert_on_error(error) | ||
|
||
def test_referral_events(self): | ||
# type: () -> None | ||
schema_checker = check_dict([ | ||
('type', equals('referral')), | ||
('referrals', check_dict([ | ||
('granted', check_int), | ||
('used', check_int), | ||
])), | ||
]) | ||
events = self.do_test(lambda: do_refer_friend(self.user_profile, "[email protected]")) | ||
error = schema_checker('events[0]', events[0]) | ||
self.assert_on_error(error) | ||
|
||
def test_register_events(self): | ||
# type: () -> None | ||
realm_user_add_checker = check_dict([ | ||
|