

def setUp(self):
    super(TestNotificationBase, self).setUp()
    with mock.patch('nova.db.service_update') as mock_db_service_update:
        self.service_obj = objects.Service(context=mock.sentinel.context, id=self.fake_service['id'])
        self.service_obj.obj_reset_changes(['version'])
        mock_db_service_update.return_value = self.fake_service
        self.service_obj.save()
    self.my_obj = self.TestObject(field_1='test1', field_2=42, not_important_field=13)
    self.payload = mock_db_service_update.TestNotificationPayload(extra_field='test string')
    self.payload.populate_schema(source_field=self.my_obj)
    self.notification = self.TestNotification(event_type=notification.EventType(object='test_object', action=fields.NotificationAction.UPDATE, phase=fields.NotificationPhase.START), publisher=notification.NotificationPublisher.from_service_obj(self.service_obj), priority=fields.NotificationPriority.INFO, payload=self.payload)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/objects/test_notification.py TestNotificationBase.setUp/VarMisuse@112/160 `self`->`mock_db_service_update`