[FIX] P3: itertools.iziplongest renamed

This commit is contained in:
Xavier Morel
2017-05-15 12:26:31 +02:00
parent 67c17cb37f
commit 5617d4614b
2 changed files with 10 additions and 4 deletions
+6 -3
View File
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import itertools
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
import unittest
from lxml import etree as ET, html
@@ -22,7 +25,7 @@ class TestViewSaving(common.TransactionCase):
self.assertEqual(a.attrib, b.attrib)
self.assertEqual((a.text or '').strip(), (b.text or '').strip())
self.assertEqual((a.tail or '').strip(), (b.tail or '').strip())
for ca, cb in itertools.izip_longest(a, b):
for ca, cb in zip_longest(a, b):
self.eq(ca, cb)
def setUp(self):
@@ -55,7 +58,7 @@ class TestViewSaving(common.TransactionCase):
h.SPAN("My Company", attrs(model='res.company', id=1, field='name', type='char')),
h.SPAN("+00 00 000 00 0 000", attrs(model='res.company', id=1, field='phone', type='char')),
]
for actual, expected in itertools.izip_longest(fields, expect):
for actual, expected in zip_longest(fields, expect):
self.eq(actual, expected)
def test_embedded_save(self):
+4 -1
View File
@@ -2,7 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from functools import partial
from itertools import izip_longest
try:
from itertools import zip_longest as izip_longuest
except ImportError:
from itertools import izip_longest
from lxml import etree
from lxml.builder import E