mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
tests: Use do_create_realm where possible.
Using do_create_realm should be preferred over manual creation where possible, as it creates more realistic data.
This commit is contained in:
committed by
Tim Abbott
parent
bbe12a3967
commit
d91d3a05b9
@@ -872,8 +872,13 @@ def generate_and_send_messages(
|
||||
random.shuffle(dialog)
|
||||
texts = itertools.cycle(dialog)
|
||||
|
||||
# We need to filter out streams from the analytics realm as we don't want to generate
|
||||
# messages to its streams - and they might also have no subscribers, which would break
|
||||
# our message generation mechanism below.
|
||||
stream_ids = Stream.objects.filter(realm=get_realm("zulip")).values_list("id", flat=True)
|
||||
recipient_streams: List[int] = [
|
||||
klass.id for klass in Recipient.objects.filter(type=Recipient.STREAM)
|
||||
recipient.id
|
||||
for recipient in Recipient.objects.filter(type=Recipient.STREAM, type_id__in=stream_ids)
|
||||
]
|
||||
recipient_huddles: List[int] = [h.id for h in Recipient.objects.filter(type=Recipient.HUDDLE)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user