s/assertItemsEqual/assertCountEqual/g

assertItemsEqual was renamed to assertCountEqual in Python 3, and the
testsuite is failing now - rename it.
See also https://six.readthedocs.io/#six.assertCountEqual

This unbreaks the testsuite.

Change-Id: I4c9d3d1f6a5566f46b00f69d8f45487472405ffe
This commit is contained in:
Ivan Kolodyazhny 2020-01-20 18:50:28 +02:00
parent 101bff9c6e
commit 0e1c0e0a6c
3 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ class AuditTemplatesTest(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'infra_optim/audit_templates/index.html') self.assertTemplateUsed(res, 'infra_optim/audit_templates/index.html')
audit_templates = res.context['audit_templates_table'].data audit_templates = res.context['audit_templates_table'].data
self.assertItemsEqual(audit_templates, self.audit_templates.list()) self.assertCountEqual(audit_templates, self.audit_templates.list())
@mock.patch.object(api.watcher.AuditTemplate, 'list') @mock.patch.object(api.watcher.AuditTemplate, 'list')
def test_audit_template_list_unavailable(self, mock_list): def test_audit_template_list_unavailable(self, mock_list):
@ -88,7 +88,7 @@ class AuditTemplatesTest(test.BaseAdminViewTests):
self.assertTemplateUsed(res, self.assertTemplateUsed(res,
'infra_optim/audit_templates/details.html') 'infra_optim/audit_templates/details.html')
audit_templates = res.context['audit_template'] audit_templates = res.context['audit_template']
self.assertItemsEqual([audit_templates], [at]) self.assertCountEqual([audit_templates], [at])
@mock.patch.object(api.watcher.AuditTemplate, 'get') @mock.patch.object(api.watcher.AuditTemplate, 'get')
def test_details_exception(self, m_get): def test_details_exception(self, m_get):

View File

@ -32,7 +32,7 @@ class GoalsTest(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'infra_optim/goals/index.html') self.assertTemplateUsed(res, 'infra_optim/goals/index.html')
goals = res.context['goals_table'].data goals = res.context['goals_table'].data
self.assertItemsEqual(goals, self.goals.list()) self.assertCountEqual(goals, self.goals.list())
@mock.patch.object(api.watcher.Goal, 'list') @mock.patch.object(api.watcher.Goal, 'list')
def test_goal_list_unavailable(self, mock_list): def test_goal_list_unavailable(self, mock_list):
@ -52,7 +52,7 @@ class GoalsTest(test.BaseAdminViewTests):
res = self.client.get(DETAILS_URL) res = self.client.get(DETAILS_URL)
self.assertTemplateUsed(res, 'infra_optim/goals/details.html') self.assertTemplateUsed(res, 'infra_optim/goals/details.html')
goals = res.context['goal'] goals = res.context['goal']
self.assertItemsEqual([goals], [goal]) self.assertCountEqual([goals], [goal])
@mock.patch.object(api.watcher.Goal, 'get') @mock.patch.object(api.watcher.Goal, 'get')
def test_details_exception(self, mock_get): def test_details_exception(self, mock_get):

View File

@ -41,7 +41,7 @@ class StrategiesTest(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'infra_optim/strategies/index.html') self.assertTemplateUsed(res, 'infra_optim/strategies/index.html')
strategies = res.context['strategies_table'].data strategies = res.context['strategies_table'].data
self.assertItemsEqual(strategies, self.strategies.list()) self.assertCountEqual(strategies, self.strategies.list())
@mock.patch.object(api.watcher.Strategy, 'list') @mock.patch.object(api.watcher.Strategy, 'list')
def test_strategy_list_unavailable(self, mock_list): def test_strategy_list_unavailable(self, mock_list):
@ -61,7 +61,7 @@ class StrategiesTest(test.BaseAdminViewTests):
self.assertTemplateUsed(res, self.assertTemplateUsed(res,
'infra_optim/strategies/details.html') 'infra_optim/strategies/details.html')
strategies = res.context['strategy'] strategies = res.context['strategy']
self.assertItemsEqual([strategies], [at]) self.assertCountEqual([strategies], [at])
@mock.patch.object(api.watcher.Strategy, 'get') @mock.patch.object(api.watcher.Strategy, 'get')
def test_details_exception(self, mock_get): def test_details_exception(self, mock_get):