@slow('Creates and subscribes 10 users in a loop.  Should use bulk queries.')
def test_num_queries_with_streams(self) -> None:
    main_user = self.example_user('hamlet')
    other_user = self.example_user('cordelia')
    realm_id = main_user.realm_id
    self.login(main_user.email)
    for i in range(10):
        stream_name = ('test_stream_' + str(i))
        stream = self.make_stream(stream_name)
        DefaultStream.objects.create(realm_id=realm_id, stream_id=stream.id)
        for user in [main_user, other_user]:
            self.subscribe(user, stream_name)
    self._get_home_page()
    flush_per_request_caches()
    with queries_captured() as queries2:
        result = self._get_home_page()
    self.assert_length(queries2, 35)
    html = result.content.decode('utf-8')
    self.assertIn('test_stream_7', html)
@slow('Creates and subscribes 10 users in a loop.  Should use bulk queries.')
def test_num_queries_with_streams(self) -> None:
    main_user = self.example_user('hamlet')
    other_user = self.example_user('cordelia')
    realm_id = main_user.realm_id
    self.login(main_user.email)
    for i in range(10):
        stream_name = ('test_stream_' + str(i))
        stream = self.make_stream(stream_name)
        DefaultStream.objects.create(realm_id=realm_id, stream_id=stream.id)
        for user in [main_user, other_user]:
            self.subscribe(user, stream_name)
    self._get_home_page()
    flush_per_request_caches()
    with queries_captured() as queries2:
        result = self._get_home_page()
    self.assert_length(queries2, 35)
    html = result.content.decode('utf-8')
    self.assertIn('test_stream_7', html)