diff --git a/product/ERP5/tests/erp5_url_checker.py b/product/ERP5/tests/erp5_url_checker.py index bfb4ee13b08fb5e6164327015f87e933b1246b95..de57238851a96831f3055502945e31d1c55a3578 100644 --- a/product/ERP5/tests/erp5_url_checker.py +++ b/product/ERP5/tests/erp5_url_checker.py @@ -116,7 +116,7 @@ class URLOpener(FancyURLopener): if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) - for args in self.addheaders: apply(h.putheader, args) + for args in self.addheaders: h.putheader(*args) h.endheaders() if data is not None: h.send(data + '\r\n') diff --git a/product/ERP5Type/tests/Python3StyleTest.py b/product/ERP5Type/tests/Python3StyleTest.py index 283e43fab51d200ba134878d1bb8b38a2b323beb..9541ab1ba28306d13ac5a290e5816d1a110c1451 100644 --- a/product/ERP5Type/tests/Python3StyleTest.py +++ b/product/ERP5Type/tests/Python3StyleTest.py @@ -75,18 +75,20 @@ class Python3StyleTest(ERP5TypeTestCase): if error: self.fail(error) - def test_raiseFixApplied(self): - self._testFixer('raise') - - def test_importFixApplied(self): - self._testFixer('import') + def test_applyFixApplied(self): + self._testFixer('apply') def test_hasKeyFixApplied(self): self._testFixer('has_key') + def test_importFixApplied(self): + self._testFixer('import') + def test_numliteralsFixApplied(self): self._testFixer('numliterals') + def test_raiseFixApplied(self): + self._testFixer('raise') def test_suite(): suite = unittest.TestSuite() diff --git a/product/Formulator/tests/testFormValidator.py b/product/Formulator/tests/testFormValidator.py index faefa8272d9eb7c0acb272b8befd866ddf65b66e..4b364e7ab354af91bc121a21a9599ae01d2b7df6 100644 --- a/product/Formulator/tests/testFormValidator.py +++ b/product/Formulator/tests/testFormValidator.py @@ -27,7 +27,7 @@ class TestField: class ValidatorTestCase(unittest.TestCase): def assertValidatorRaises(self, exception, error_key, f, *args, **kw): try: - apply(f, args, kw) + f(*args, **kw) except exception as e: if hasattr(e, 'error_key') and e.error_key != error_key: self.fail('Got wrong error. Expected %s received %s' %