'Check if signing up without a password works properly when
password_auth_enabled is False.'

def test_signup_without_password(self):

    email = self.nonreg_email('newuser')
    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)
    with patch('zerver.views.registration.password_auth_enabled', return_value=False):
        result = self.client_post('/accounts/register/', {'full_name': 'New    User', 'realm_name': 'Zulip    Test', 'realm_subdomain': 'zuliptest', 'key': find_key_by_email(email), 'terms': True})
    self.assertEqual(result.status_code, 302)
    user_profile = self.nonreg_user('newuser')
    self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
