'Sending messages without a to field should be sent to the default
stream for the user_profile.'

def test_api_message_with_default_to(self):

    user_profile = self.example_user('hamlet')
    email = user_profile.email
    user_profile.default_sending_stream = get_stream('Verona', user_profile.realm)
    user_profile.save()
    result = self.client_post('/api/v1/messages', {'type': 'stream', 'client': 'test    suite', 'content': 'Test    message    no    to', 'subject': 'Test    subject'}, **self.api_auth(email))
    self.assert_json_success(result)
    sent_message = self.get_last_message()
    self.assertEqual(sent_message.content, 'Test    message    no    to')
