From 328f9e08c18507337c001754969e67f80764b351 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 16 Nov 2021 09:20:56 +0100 Subject: [PATCH] attachment_swift: Restore 9.0 compat in test Restore import to openerp and py2.7 compat --- attachment_swift/tests/test_mock_swift_api.py | 11 ++++++----- attachment_swift/tests/test_with_swift_store.py | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/attachment_swift/tests/test_mock_swift_api.py b/attachment_swift/tests/test_mock_swift_api.py index 11a5421..8a53c8d 100644 --- a/attachment_swift/tests/test_mock_swift_api.py +++ b/attachment_swift/tests/test_mock_swift_api.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2017-2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) @@ -9,15 +10,15 @@ from mock import patch import keystoneauth1 -from odoo.addons.base.tests.test_ir_attachment import TestIrAttachment -from odoo.addons.attachment_swift.models.ir_attachment import SwiftSessionStore -from odoo.addons.attachment_swift.swift_uri import SwiftUri +from openerp.addons.base.tests.test_ir_attachment import test_ir_attachment +from openerp.addons.attachment_swift.models.ir_attachment import SwiftSessionStore +from openerp.addons.attachment_swift.swift_uri import SwiftUri -class TestAttachmentSwift(TestIrAttachment): +class TestAttachmentSwift(test_ir_attachment): def setup(self): - super().setUp() + super(TestAttachmentSwift, self).setUp() self.env['ir.config_parameter'].set_param('ir_attachment.location', 'swift') diff --git a/attachment_swift/tests/test_with_swift_store.py b/attachment_swift/tests/test_with_swift_store.py index dcfd54d..5c75f79 100644 --- a/attachment_swift/tests/test_with_swift_store.py +++ b/attachment_swift/tests/test_with_swift_store.py @@ -2,12 +2,12 @@ # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from openerp.addons.base.tests.test_ir_attachment import TestIrAttachment +from openerp.addons.base.tests.test_ir_attachment import test_ir_attachment from ..swift_uri import SwiftUri from swiftclient.exceptions import ClientException -class TestAttachmentSwift(TestIrAttachment): +class TestAttachmentSwift(test_ir_attachment): """ Those tests are made to be run against a real Swift store (local or remote) """