mirror of https://github.com/zulip/zulip.git
minor: Fix user/stream in test_subscriptions.
This commit is contained in:
parent
9df9934ed6
commit
188cc9bb3b
|
@ -206,24 +206,24 @@ class TestRealmAuditLog(ZulipTestCase):
|
|||
def test_subscriptions(self) -> None:
|
||||
now = timezone_now()
|
||||
|
||||
user = [self.example_user('hamlet')]
|
||||
stream = [self.make_stream('test_stream')]
|
||||
user = self.example_user('hamlet')
|
||||
stream = self.make_stream('test_stream')
|
||||
acting_user = self.example_user('iago')
|
||||
bulk_add_subscriptions(user[0].realm, stream, user, acting_user=acting_user)
|
||||
bulk_add_subscriptions(user.realm, [stream], [user], acting_user=acting_user)
|
||||
subscription_creation_logs = RealmAuditLog.objects.filter(event_type=RealmAuditLog.SUBSCRIPTION_CREATED,
|
||||
event_time__gte=now, acting_user=acting_user, modified_user=user[0],
|
||||
modified_stream=stream[0])
|
||||
event_time__gte=now, acting_user=acting_user, modified_user=user,
|
||||
modified_stream=stream)
|
||||
self.assertEqual(subscription_creation_logs.count(), 1)
|
||||
self.assertEqual(subscription_creation_logs[0].modified_stream.id, stream[0].id)
|
||||
self.assertEqual(subscription_creation_logs[0].modified_user, user[0])
|
||||
self.assertEqual(subscription_creation_logs[0].modified_stream.id, stream.id)
|
||||
self.assertEqual(subscription_creation_logs[0].modified_user, user)
|
||||
|
||||
bulk_remove_subscriptions(user, stream, get_client("website"), acting_user=acting_user)
|
||||
bulk_remove_subscriptions([user], [stream], get_client("website"), acting_user=acting_user)
|
||||
subscription_deactivation_logs = RealmAuditLog.objects.filter(event_type=RealmAuditLog.SUBSCRIPTION_DEACTIVATED,
|
||||
event_time__gte=now, acting_user=acting_user, modified_user=user[0],
|
||||
modified_stream=stream[0])
|
||||
event_time__gte=now, acting_user=acting_user, modified_user=user,
|
||||
modified_stream=stream)
|
||||
self.assertEqual(subscription_deactivation_logs.count(), 1)
|
||||
self.assertEqual(subscription_deactivation_logs[0].modified_stream.id, stream[0].id)
|
||||
self.assertEqual(subscription_deactivation_logs[0].modified_user, user[0])
|
||||
self.assertEqual(subscription_deactivation_logs[0].modified_stream.id, stream.id)
|
||||
self.assertEqual(subscription_deactivation_logs[0].modified_user, user)
|
||||
|
||||
def test_realm_activation(self) -> None:
|
||||
realm = get_realm('zulip')
|
||||
|
|
Loading…
Reference in New Issue