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.

test_events: Fix test_change_date_joined in a fresh test database.

Anders Kaseorg56f89059ee4e
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index c17d4a50c15..2116d27ce4c 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -2710,9 +2710,9 @@ class NormalActionsTest(BaseAction):
do_change_full_name(cordelia, "Cordelia", self.user_profile, notify=False)
def test_change_date_joined(self) -> None:
- now = timezone_now()
+ new_date_joined = self.user_profile.date_joined - timedelta(days=1)
with self.verify_action() as events:
- do_change_user_date_joined(self.user_profile, now)
+ do_change_user_date_joined(self.user_profile, new_date_joined)
check_realm_user_update("events[0]", events[0], "date_joined")
def test_change_user_delivery_email_email_address_visibility_admins(self) -> None: