@@ -233,7 +233,7 @@ def logged_on_user() -> Dict[str, Any]:
233
233
234
234
235
235
@pytest .fixture
236
- def general_stream () -> Dict [ str , Any ] :
236
+ def general_stream () -> Subscription :
237
237
return {
238
238
"name" : "Some general stream" ,
239
239
"date_created" : 1472091253 ,
@@ -245,21 +245,25 @@ def general_stream() -> Dict[str, Any]:
245
245
"audible_notifications" : False ,
246
246
"description" : "General Stream" ,
247
247
"rendered_description" : "General Stream" ,
248
- "is_old_stream" : True ,
249
248
"desktop_notifications" : False ,
250
249
"stream_weekly_traffic" : 0 ,
251
250
"push_notifications" : False ,
252
251
"email_address" :
"[email protected] " ,
253
252
"message_retention_days" : 10 ,
254
253
"subscribers" : [1001 , 11 , 12 ],
255
254
"history_public_to_subscribers" : True ,
255
+ "is_announcement_only" : False ,
256
+ "first_message_id" : 1 ,
257
+ "email_notifications" : False ,
258
+ "wildcard_mentions_notify" : False ,
259
+ "is_web_public" : False ,
256
260
}
257
261
258
262
259
263
# This is a private stream;
260
264
# only description/stream_id/invite_only/name/color vary from above
261
265
@pytest .fixture
262
- def secret_stream () -> Dict [ str , Any ] :
266
+ def secret_stream () -> Subscription :
263
267
return {
264
268
"description" : "Some private stream" ,
265
269
"stream_id" : 99 ,
@@ -272,19 +276,23 @@ def secret_stream() -> Dict[str, Any]:
272
276
"color" : "#ccc" , # Color in '#xxx' format
273
277
"is_muted" : False ,
274
278
"audible_notifications" : False ,
275
- "is_old_stream" : True ,
276
279
"desktop_notifications" : False ,
277
280
"stream_weekly_traffic" : 0 ,
278
281
"message_retention_days" : - 1 ,
279
282
"push_notifications" : False ,
280
283
"subscribers" : [1001 , 11 ],
281
284
"history_public_to_subscribers" : False ,
285
+ "is_announcement_only" : False ,
286
+ "first_message_id" : 1 ,
287
+ "email_notifications" : False ,
288
+ "wildcard_mentions_notify" : False ,
289
+ "is_web_public" : False ,
282
290
}
283
291
284
292
285
293
# Like public stream but with is_web_public=True
286
294
@pytest .fixture
287
- def web_public_stream () -> Dict [ str , Any ] :
295
+ def web_public_stream () -> Subscription :
288
296
return {
289
297
"description" : "Some web public stream" ,
290
298
"stream_id" : 999 ,
@@ -297,23 +305,26 @@ def web_public_stream() -> Dict[str, Any]:
297
305
"color" : "#ddd" , # Color in '#xxx' format
298
306
"is_muted" : False ,
299
307
"audible_notifications" : False ,
300
- "is_old_stream" : True ,
301
308
"desktop_notifications" : False ,
302
309
"stream_weekly_traffic" : 0 ,
303
310
"message_retention_days" : - 1 ,
304
311
"push_notifications" : False ,
305
312
"subscribers" : [1001 , 11 ],
306
313
"history_public_to_subscribers" : False ,
307
314
"is_web_public" : True ,
315
+ "is_announcement_only" : False ,
316
+ "first_message_id" : 1 ,
317
+ "email_notifications" : False ,
318
+ "wildcard_mentions_notify" : False ,
308
319
}
309
320
310
321
311
322
@pytest .fixture
312
323
def streams_fixture (
313
- general_stream : Dict [ str , Any ] ,
314
- secret_stream : Dict [ str , Any ] ,
315
- web_public_stream : Dict [ str , Any ] ,
316
- ) -> List [Dict [ str , Any ] ]:
324
+ general_stream : Subscription ,
325
+ secret_stream : Subscription ,
326
+ web_public_stream : Subscription ,
327
+ ) -> List [Subscription ]:
317
328
streams = [general_stream , secret_stream , web_public_stream ]
318
329
for i in range (1 , 3 ):
319
330
streams .append (
@@ -328,14 +339,18 @@ def streams_fixture(
328
339
"audible_notifications" : False ,
329
340
"description" : f"A description of stream { i } " ,
330
341
"rendered_description" : f"A description of stream { i } " ,
331
- "is_old_stream" : True ,
332
342
"desktop_notifications" : False ,
333
343
"stream_weekly_traffic" : 0 ,
334
344
"push_notifications" : False ,
335
345
"message_retention_days" : i + 30 ,
336
346
"email_address" : f"stream{ i } @example.com" ,
337
347
"subscribers" : [1001 , 11 , 12 ],
338
348
"history_public_to_subscribers" : True ,
349
+ "is_announcement_only" : False ,
350
+ "first_message_id" : 1 ,
351
+ "email_notifications" : False ,
352
+ "wildcard_mentions_notify" : False ,
353
+ "is_web_public" : False ,
339
354
}
340
355
)
341
356
return deepcopy (streams )
@@ -933,7 +948,7 @@ def clean_custom_profile_data_fixture() -> List[CustomProfileData]:
933
948
def initial_data (
934
949
logged_on_user : Dict [str , Any ],
935
950
users_fixture : List [Dict [str , Any ]],
936
- streams_fixture : List [Dict [ str , Any ] ],
951
+ streams_fixture : List [Subscription ],
937
952
unsubscribed_streams_fixture : List [Subscription ],
938
953
never_subscribed_streams_fixture : List [Stream ],
939
954
realm_emojis : Dict [str , Dict [str , Any ]],
@@ -1462,7 +1477,7 @@ def user_id(logged_on_user: Dict[str, Any]) -> int:
1462
1477
1463
1478
1464
1479
@pytest .fixture
1465
- def stream_dict (streams_fixture : List [Dict [ str , Any ]] ) -> Dict [int , Any ]:
1480
+ def stream_dict (streams_fixture : List [Subscription ] ) -> Dict [int , Subscription ]:
1466
1481
return {stream ["stream_id" ]: stream for stream in streams_fixture }
1467
1482
1468
1483
0 commit comments