summaryrefslogtreecommitdiff
path: root/odoo/addons/test_new_api/tests
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-11-08 15:27:30 +0000
committerAdrian Torres <adt@odoo.com>2018-11-29 09:28:17 +0000
commit52f5528cfb6d1152ee226e268247dc685a8ba329 (patch)
treeb44ecfa477b50dd3e488f09f623eecc8bc8e9d7d /odoo/addons/test_new_api/tests
parente5c864a596b72515837f0ed1e07550398ecc1ab0 (diff)
[REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
Diffstat (limited to 'odoo/addons/test_new_api/tests')
-rw-r--r--odoo/addons/test_new_api/tests/test_attributes.py3
-rw-r--r--odoo/addons/test_new_api/tests/test_new_fields.py6
2 files changed, 4 insertions, 5 deletions
diff --git a/odoo/addons/test_new_api/tests/test_attributes.py b/odoo/addons/test_new_api/tests/test_attributes.py
index b37afe7e30d..94a048f2554 100644
--- a/odoo/addons/test_new_api/tests/test_attributes.py
+++ b/odoo/addons/test_new_api/tests/test_attributes.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from odoo.tests import common
-from odoo.tools import pycompat
ANSWER_TO_ULTIMATE_QUESTION = 42
@@ -17,7 +16,7 @@ class TestAttributes(common.TransactionCase):
self.assertTrue(hasattr(instance, 'unknown'))
# Is it the right type ?
- self.assertIsInstance(instance.unknown, pycompat.integer_types)
+ self.assertIsInstance(instance.unknown, int)
# Is it the right value, in case of, we don't know ;-)
self.assertEqual(instance.unknown, ANSWER_TO_ULTIMATE_QUESTION)
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py
index 021fad63e39..358efcb575f 100644
--- a/odoo/addons/test_new_api/tests/test_new_fields.py
+++ b/odoo/addons/test_new_api/tests/test_new_fields.py
@@ -6,7 +6,7 @@ from datetime import date, datetime, time
from odoo import fields
from odoo.exceptions import AccessError, UserError
from odoo.tests import common
-from odoo.tools import mute_logger, float_repr, pycompat
+from odoo.tools import mute_logger, float_repr
from odoo.tools.date_utils import add, subtract, start_of, end_of
@@ -18,8 +18,8 @@ class TestFields(common.TransactionCase):
discussion = self.env.ref('test_new_api.discussion_0')
# read field as a record attribute or as a record item
- self.assertIsInstance(discussion.name, pycompat.string_types)
- self.assertIsInstance(discussion['name'], pycompat.string_types)
+ self.assertIsInstance(discussion.name, str)
+ self.assertIsInstance(discussion['name'], str)
self.assertEqual(discussion['name'], discussion.name)
# read it with method read()