mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	streams: refactor stream creation code path.
Refactor list_to_streams and create_streams_if_needed to take a list of dictionaries, instead of a list of stream names. This is preparation for being able to pass additional arguments into the stream creation process. An important note: This removes a set of validation code from the start of add_subscriptions_backend; doing so is correct because list_to_streams has that same validation code already. [with some tweaks by tabbott for clarity]
This commit is contained in:
		@@ -63,7 +63,7 @@ class TestCreateStreams(ZulipTestCase):
 | 
			
		||||
 | 
			
		||||
        new_streams, existing_streams = create_streams_if_needed(
 | 
			
		||||
            realm,
 | 
			
		||||
            stream_names,
 | 
			
		||||
            [{"name": stream_name} for stream_name in stream_names],
 | 
			
		||||
            invite_only=True)
 | 
			
		||||
        self.assertEqual(len(new_streams), 3)
 | 
			
		||||
        self.assertEqual(len(existing_streams), 0)
 | 
			
		||||
@@ -73,7 +73,7 @@ class TestCreateStreams(ZulipTestCase):
 | 
			
		||||
 | 
			
		||||
        new_streams, existing_streams = create_streams_if_needed(
 | 
			
		||||
            realm,
 | 
			
		||||
            stream_names,
 | 
			
		||||
            [{"name": stream_name} for stream_name in stream_names],
 | 
			
		||||
            invite_only=True)
 | 
			
		||||
        self.assertEqual(len(new_streams), 0)
 | 
			
		||||
        self.assertEqual(len(existing_streams), 3)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user