From 0e1c0e0a6c45fd29cf5f1aaf0c60f1727ebf2825 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Mon, 20 Jan 2020 18:50:28 +0200 Subject: [PATCH] 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 --- watcher_dashboard/content/audit_templates/tests.py | 4 ++-- watcher_dashboard/content/goals/tests.py | 4 ++-- watcher_dashboard/content/strategies/tests.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/watcher_dashboard/content/audit_templates/tests.py b/watcher_dashboard/content/audit_templates/tests.py index 1ac6c9a..de87d90 100644 --- a/watcher_dashboard/content/audit_templates/tests.py +++ b/watcher_dashboard/content/audit_templates/tests.py @@ -40,7 +40,7 @@ class AuditTemplatesTest(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) self.assertTemplateUsed(res, 'infra_optim/audit_templates/index.html') 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') def test_audit_template_list_unavailable(self, mock_list): @@ -88,7 +88,7 @@ class AuditTemplatesTest(test.BaseAdminViewTests): self.assertTemplateUsed(res, 'infra_optim/audit_templates/details.html') audit_templates = res.context['audit_template'] - self.assertItemsEqual([audit_templates], [at]) + self.assertCountEqual([audit_templates], [at]) @mock.patch.object(api.watcher.AuditTemplate, 'get') def test_details_exception(self, m_get): diff --git a/watcher_dashboard/content/goals/tests.py b/watcher_dashboard/content/goals/tests.py index e11a875..17a7e0d 100644 --- a/watcher_dashboard/content/goals/tests.py +++ b/watcher_dashboard/content/goals/tests.py @@ -32,7 +32,7 @@ class GoalsTest(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) self.assertTemplateUsed(res, 'infra_optim/goals/index.html') 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') def test_goal_list_unavailable(self, mock_list): @@ -52,7 +52,7 @@ class GoalsTest(test.BaseAdminViewTests): res = self.client.get(DETAILS_URL) self.assertTemplateUsed(res, 'infra_optim/goals/details.html') goals = res.context['goal'] - self.assertItemsEqual([goals], [goal]) + self.assertCountEqual([goals], [goal]) @mock.patch.object(api.watcher.Goal, 'get') def test_details_exception(self, mock_get): diff --git a/watcher_dashboard/content/strategies/tests.py b/watcher_dashboard/content/strategies/tests.py index 8aecca5..1fc425a 100644 --- a/watcher_dashboard/content/strategies/tests.py +++ b/watcher_dashboard/content/strategies/tests.py @@ -41,7 +41,7 @@ class StrategiesTest(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) self.assertTemplateUsed(res, 'infra_optim/strategies/index.html') 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') def test_strategy_list_unavailable(self, mock_list): @@ -61,7 +61,7 @@ class StrategiesTest(test.BaseAdminViewTests): self.assertTemplateUsed(res, 'infra_optim/strategies/details.html') strategies = res.context['strategy'] - self.assertItemsEqual([strategies], [at]) + self.assertCountEqual([strategies], [at]) @mock.patch.object(api.watcher.Strategy, 'get') def test_details_exception(self, mock_get):