Commit 6919b667 authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

Migrate cube to Python3

- Fix errors:
  - TypeError: 'float' object cannot be interpreted as an integer

- Fix deprecation warnings:
  - DeprecationWarning: Please use assertEqual instead
  - DeprecationWarning: Please use assertTrue instead
parent c0284229c882
......@@ -228,7 +228,7 @@ class ElasticSearchView(StartupView):
href=xml_escape(self._cw.build_url(**url_params)))))
else:
ul(t.li(t.a(self.previous_link)))
total_pages = min((response.hits.total / 10) + 2, 1000)
total_pages = min((response.hits.total // 10) + 2, 1000)
page_padding = 3
if current_page > page_padding:
......
......@@ -64,7 +64,7 @@ class ExportElasticSearchTC(testlib.AutoPopulateTest):
ccplugin.IndexInES(None).main_run(cmd)
finally:
sys.stdout = sys.__stdout__
self.assertEquals('', out.getvalue())
self.assertEqual('', out.getvalue())
create.assert_not_called()
bulk.assert_not_called()
......@@ -78,7 +78,7 @@ class ExportElasticSearchTC(testlib.AutoPopulateTest):
finally:
sys.stdout = sys.__stdout__
with self.admin_access.repo_cnx() as cnx:
self.assert_(cnx.execute('Any X WHERE X is %(etype)s' %
self.assertTrue(cnx.execute('Any X WHERE X is %(etype)s' %
{'etype': self.tested_etype}))
# TODO - put this somewhere where it tests on the first get_connection
# create.assert_called_with(ignore=400,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment