def test_audit_transfer_request_update(self):
        ztransfer_request = objects.ZoneTransferRequest(
            zone_id='123',
            zone_name='example.com.',
            target_tenant_id='tenant_a',
        )

        ztransfer_request.target_tenant_id = 'tenant_b'

        result = ztransfer_request
        event = 'dns.zone_transfer_request.update'
        args = (ztransfer_request, )
        kwargs = {'wumbo': 'mumbo'}

        expected = [{
            'changed_field': 'target_tenant_id',
            'new_data': 'tenant_b',
            'old_data': 'tenant_a',
            'recordset_name': None,
            'zone_id': '123',
            'zone_name': 'example.com.'
        }]
        driver_result = self.driver.emit(event, self.context, result, args,
                                         kwargs)
        self.assertEqual(driver_result, expected)
    def test_audit_transfer_request_delete(self):
        ztransfer_request = objects.ZoneTransferRequest(
                zone_id=AuditNotificationTest.zone__id,
                zone_name='example.com.',
                target_tenant_id='tenant_a',
        )

        result = ztransfer_request
        event = 'dns.zone_transfer_request.create'
        args = (AuditNotificationTest.zone__transfer)
        kwargs = {'wumbo': 'mumbo'}

        expected = [{
            'changed_field': None,
            'new_data': None,
            'old_data': None,
            'recordset_name': None,
            'zone_id': AuditNotificationTest.zone__id,
            'zone_name': 'example.com.'
        }]
        driver_result = self.driver.emit(
            event, self.context, result, args, kwargs)
        self.assertEqual(driver_result, expected)