

@patch('orchestra.accounts.forms.get_slack_user_id')
def test_change_all_fields(self, mock_get_slack_user_id):
    mock_get_slack_user_id.return_value = 'test_id'
    data = self._get_account_settings_mock_data()
    response = self.request_client.post(self.url, data)
    self.assertTrue(response.context['success'])
    self.user.refresh_from_db()
    self.assertEqual(self.user.first_name, data['first_name'])
    self.assertEqual(self.user.last_name, data['last_name'])
    self.worker.refresh_from_db()
    self.assertEqual(self.worker.slack_username, data['slack_username'])
    self.assertEqual(self.worker.phone, (data['phone_0'] + data['phone_1']))
    self.assertEqual(self.worker.slack_user_id, 'test_id')

dataset/ETHPy150Open unlimitedlabs/orchestra/orchestra/accounts/tests/test_views.py AccountSettingsTest.test_change_all_fields/original