Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

users: Add new user 'shiva' as realm moderator.

sahil8396b5cf231a1b8
diff --git a/frontend_tests/puppeteer_tests/04-subscriptions.ts b/frontend_tests/puppeteer_tests/04-subscriptions.ts
index 520f844e515..098bc5750bf 100644
--- a/frontend_tests/puppeteer_tests/04-subscriptions.ts
+++ b/frontend_tests/puppeteer_tests/04-subscriptions.ts
@@ -173,9 +173,9 @@ async function create_stream(page: Page): Promise<void> {
assert.strictEqual(stream_name, "Puppeteer");
assert.strictEqual(stream_description, "Everything Puppeteer");
- // Assert subscriber count becomes 5(scotland(+4), cordelia(+1), othello(-1), Desdemona(+1)).
+ // Assert subscriber count becomes 6(scotland(+5), cordelia(+1), othello(-1), Desdemona(+1)).
await page.waitForFunction(
- (subscriber_count_selector: string) => $(subscriber_count_selector).text().trim() === "5",
+ (subscriber_count_selector: string) => $(subscriber_count_selector).text().trim() === "6",
{},
subscriber_count_selector,
);
diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py
index 012a38759ea..d54bbda0020 100644
--- a/zerver/lib/test_classes.py
+++ b/zerver/lib/test_classes.py
@@ -379,6 +379,7 @@ Output:
polonius="[email protected]",
desdemona="[email protected]",
webhook_bot="[email protected]",
welcome_bot="[email protected]",
outgoing_webhook_bot="[email protected]",
diff --git a/zerver/openapi/python_examples.py b/zerver/openapi/python_examples.py
index 0bdd9d27c55..4e097140e46 100644
--- a/zerver/openapi/python_examples.py
+++ b/zerver/openapi/python_examples.py
@@ -84,7 +84,7 @@ def add_subscriptions(client: Client) -> None:
# {code_example|start}
# To subscribe other users to a stream, you may pass
# the `principals` argument, like so:
- user_id = 25
+ user_id = 26
result = client.add_subscriptions(
streams=[
{"name": "new stream", "description": "New stream for testing"},
diff --git a/zerver/tests/test_import_export.py b/zerver/tests/test_import_export.py
index 8a094dfaa16..f73de71ceaf 100644
--- a/zerver/tests/test_import_export.py
+++ b/zerver/tests/test_import_export.py
@@ -481,7 +481,7 @@ class ImportExportTest(ZulipTestCase):
# We set up 4 alert words for Hamlet, Cordelia, etc.
# when we populate the test database.
- num_zulip_users = 9
+ num_zulip_users = 10
self.assertEqual(len(exported_alert_words), num_zulip_users * 4)
self.assertIn("robotics", {r["word"] for r in exported_alert_words})
diff --git a/zerver/tests/test_management_commands.py b/zerver/tests/test_management_commands.py
index 1afe345c567..2f6963fabaa 100644
--- a/zerver/tests/test_management_commands.py
+++ b/zerver/tests/test_management_commands.py
@@ -523,7 +523,7 @@ class TestExport(ZulipTestCase):
call("\033[94mExporting realm\033[0m: zulip"),
call("\n\033[94mMessage content:\033[0m\nOutbox emoji for export\n"),
call(
- "\033[94mNumber of users that reacted outbox:\033[0m 2 / 8 total non-guest users\n"
+ "\033[94mNumber of users that reacted outbox:\033[0m 2 / 9 total non-guest users\n"
),
],
)
diff --git a/zerver/tests/test_soft_deactivation.py b/zerver/tests/test_soft_deactivation.py
index ff1f110beee..a936123cf67 100644
--- a/zerver/tests/test_soft_deactivation.py
+++ b/zerver/tests/test_soft_deactivation.py
@@ -88,6 +88,7 @@ class UserSoftDeactivationTests(ZulipTestCase):
self.example_user("aaron"),
self.example_user("polonius"),
self.example_user("desdemona"),
+ self.example_user("shiva"),
]
client, _ = Client.objects.get_or_create(name="website")
query = "/some/random/endpoint"
@@ -104,7 +105,7 @@ class UserSoftDeactivationTests(ZulipTestCase):
filter_kwargs = dict(user_profile__realm=get_realm("zulip"))
users_to_deactivate = get_users_for_soft_deactivation(-1, filter_kwargs)
- self.assert_length(users_to_deactivate, 9)
+ self.assert_length(users_to_deactivate, 10)
for user in users_to_deactivate:
self.assertTrue(user in users)
@@ -155,6 +156,7 @@ class UserSoftDeactivationTests(ZulipTestCase):
self.example_user("aaron"),
self.example_user("polonius"),
self.example_user("desdemona"),
+ self.example_user("shiva"),
]
for user_profile in UserProfile.objects.all():
user_profile.long_term_idle = True
@@ -163,7 +165,7 @@ class UserSoftDeactivationTests(ZulipTestCase):
filter_kwargs = dict(realm=get_realm("zulip"))
users_to_catch_up = get_soft_deactivated_users_for_catch_up(filter_kwargs)
- self.assert_length(users_to_catch_up, 9)
+ self.assert_length(users_to_catch_up, 10)
for user in users_to_catch_up:
self.assertTrue(user in users)
diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py
index 945846ed5cd..386cb29d6e7 100644
--- a/zerver/tests/test_subs.py
+++ b/zerver/tests/test_subs.py
@@ -3410,7 +3410,7 @@ class SubscriptionAPITest(ZulipTestCase):
)
self.assertNotIn(self.example_user("polonius").id, add_peer_event["users"])
- self.assertEqual(len(add_peer_event["users"]), 11)
+ self.assertEqual(len(add_peer_event["users"]), 12)
self.assertEqual(add_peer_event["event"]["type"], "subscription")
self.assertEqual(add_peer_event["event"]["op"], "peer_add")
self.assertEqual(add_peer_event["event"]["user_ids"], [self.user_profile.id])
@@ -3442,7 +3442,7 @@ class SubscriptionAPITest(ZulipTestCase):
# We don't send a peer_add event to othello
self.assertNotIn(user_profile.id, add_peer_event["users"])
self.assertNotIn(self.example_user("polonius").id, add_peer_event["users"])
- self.assertEqual(len(add_peer_event["users"]), 11)
+ self.assertEqual(len(add_peer_event["users"]), 12)
self.assertEqual(add_peer_event["event"]["type"], "subscription")
self.assertEqual(add_peer_event["event"]["op"], "peer_add")
self.assertEqual(add_peer_event["event"]["user_ids"], [user_profile.id])
diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py
index 9fb7f3b29da..4384226efb2 100644
--- a/zilencer/management/commands/populate_db.py
+++ b/zilencer/management/commands/populate_db.py
@@ -348,6 +348,7 @@ class Command(BaseCommand):
("aaron", "[email protected]"),
("Polonius", "[email protected]"),
("Desdemona", "[email protected]"),
+ ("शिव", "[email protected]"),
]
# For testing really large batches:
@@ -444,6 +445,9 @@ class Command(BaseCommand):
desdemona = get_user_by_delivery_email("[email protected]", zulip_realm)
do_change_user_role(desdemona, UserProfile.ROLE_REALM_OWNER, acting_user=None)
+ shiva = get_user_by_delivery_email("[email protected]", zulip_realm)
+ do_change_user_role(shiva, UserProfile.ROLE_MODERATOR, acting_user=None)
+
guest_user = get_user_by_delivery_email("[email protected]", zulip_realm)
guest_user.role = UserProfile.ROLE_GUEST
guest_user.save(update_fields=["role"])
@@ -533,6 +537,7 @@ class Command(BaseCommand):
"[email protected]": ["Verona", "Denmark", "Scotland", "Venice", "Rome"],
"[email protected]": ["Verona"],
"[email protected]": ["Verona", "Denmark", "Venice"],
+ "[email protected]": ["Verona", "Denmark", "Scotland"],
}
for profile in profiles: