'Check if the default language of new user is the default language
of the realm.'

def test_user_default_language_and_timezone(self):

    email = self.nonreg_email('newguy')
    password = 'newpassword'
    timezone = 'US/Mountain'
    realm = get_realm('zulip')
    do_set_realm_property(realm, 'default_language', u'de')
    result = self.client_post('/accounts/home/', {'email': email})
    self.assertEqual(result.status_code, 302)
    self.assertTrue(result['Location'].endswith(('/accounts/send_confirm/%s' % (email,))))
    result = self.client_get(result['Location'])
    self.assert_in_response('Check    your    email    so    we    can    get    started.', result)
    confirmation_url = self.get_confirmation_url_from_outbox(email)
    result = self.client_get(confirmation_url)
    self.assertEqual(result.status_code, 200)
    result = self.submit_reg_form_for_user(email, password, timezone=timezone)
    self.assertEqual(result.status_code, 302)
    user_profile = self.nonreg_user('newguy')
    self.assertEqual(user_profile.default_language, realm.default_language)
    self.assertEqual(user_profile.timezone, timezone)
    from django.core.mail import outbox
    outbox.pop()
