def METHOD_NAME(  # noqa: E501
    self, publish_mock
):
    self.cfv1 = CustomFieldValue.objects.create(
        object=self.dca,
        custom_field=self.custom_field_str,
        value='sample_value',
    )
    new_service = ServiceFactory(name='service1', uid='sc-44444')
    new_service_env = ServiceEnvironmentFactory(
        service=new_service, environment__name='dev'
    )
    data_custom_fields = {
        'TOTAL_FORMS': 3,
        'INITIAL_FORMS': 1,
        '0-id': self.cfv1.id,
        '0-custom_field': self.custom_field_str.id,
        '0-value': 'sample_value22',
        '1-id': '',
        '1-custom_field': self.custom_field_choices.id,
        '1-value': 'qwerty',
    }
    with transaction.atomic():
        self._update_dca(
            dca_data={
                'service_env': new_service_env.id,
                'hostname': 'my-host.mydc.net',
            },
            inline_data=data_custom_fields
        )
        # DCA is saved twice
        self.assertGreater(len(connection.run_on_commit), 0)
    self.dca.refresh_from_db()
    publish_data = publish_mock.call_args[0][1]
    publish_data.pop('modified')
    publish_data.pop('created')
    self.assertEqual(publish_data, {
        '__str__': 'data center asset: ' + str(self.dca),
        'configuration_path': None,
        'configuration_variables': {
            'test_choice': 'qwerty',
        },
        'custom_fields': {
            'test_str': 'sample_value22',
            'test_choice': 'qwerty'
        },
        'ethernet': [],
        'hostname': 'my-host.mydc.net',
        'id': self.dca.id,
        'model': str(self.dca.model),
        'ipaddresses': [],
        'object_type': 'datacenterasset',
        'parent': None,
        'remarks': '',
        'service_env': {
            'id': new_service_env.id,
            'service': 'service1',
            'environment': 'dev',
            'service_uid': 'sc-44444',
            'ui_url': ''
        },
        'tags': [],
        'securityscan': None,
        '_previous_state': {
            'hostname': 'ralph1.allegro.pl'
        },
    })
    # Despite `save` is called twice, publish update data is called only
    # once
    self.assertEqual(publish_mock.call_count, 1)
    # check if on_commit callbacks are removed from current db connections
    self.assertEqual(connection.run_on_commit, [])