mirror of https://github.com/zulip/zulip.git
analytics tests: Save recipient in stream object.
At the time of creating streams in test_counts.py we earlier did not saved recipient in the stream object. stream.recipient is used in many functions so they would throw error. The right long-term fix here is probably to just use the standard stream creation functions rather than having a hacky duplicate here.
This commit is contained in:
parent
07fa25dcd3
commit
fb2aae1c02
|
@ -77,6 +77,8 @@ class AnalyticsTestCase(TestCase):
|
|||
kwargs[key] = kwargs.get(key, value)
|
||||
stream = Stream.objects.create(**kwargs)
|
||||
recipient = Recipient.objects.create(type_id=stream.id, type=Recipient.STREAM)
|
||||
stream.recipient = recipient
|
||||
stream.save(update_fields=["recipient"])
|
||||
return stream, recipient
|
||||
|
||||
def create_huddle_with_recipient(self, **kwargs: Any) -> Tuple[Huddle, Recipient]:
|
||||
|
|
Loading…
Reference in New Issue