diff --git a/openstack_dashboard/dashboards/admin/overview/tests.py b/openstack_dashboard/dashboards/admin/overview/tests.py index 2a7372cba3..3e69613062 100644 --- a/openstack_dashboard/dashboards/admin/overview/tests.py +++ b/openstack_dashboard/dashboards/admin/overview/tests.py @@ -100,7 +100,7 @@ class UsageViewTests(test.BaseAdminViewTests): self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:overview:index')) self.assertTemplateUsed(res, 'admin/overview/usage.html') - self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) + self.assertIsInstance(res.context['usage'], usage.GlobalUsage) self.assertEqual(nova_stu_enabled, res.context['simple_tenant_usage_enabled']) @@ -191,7 +191,7 @@ class UsageViewTests(test.BaseAdminViewTests): csv_url = reverse('horizon:admin:overview:index') + "?format=csv" res = self.client.get(csv_url) self.assertTemplateUsed(res, 'admin/overview/usage.csv') - self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) + self.assertIsInstance(res.context['usage'], usage.GlobalUsage) hdr = 'Project Name,VCPUs,RAM (MB),Disk (GB),Usage (Hours)' self.assertContains(res, '%s\r\n' % hdr) diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py index e63b09f45f..f6d4f11154 100644 --- a/openstack_dashboard/dashboards/identity/projects/tests.py +++ b/openstack_dashboard/dashboards/identity/projects/tests.py @@ -1566,7 +1566,7 @@ class UsageViewTests(test.BaseAdminViewTests): res = self.client.get(csv_url) self.assertTemplateUsed(res, 'project/overview/usage.csv') - self.assertTrue(isinstance(res.context['usage'], usage.ProjectUsage)) + self.assertIsInstance(res.context['usage'], usage.ProjectUsage) hdr = ('Instance Name,VCPUs,RAM (MB),Disk (GB),Usage (Hours),' 'Time since created (Seconds),State') self.assertContains(res, '%s\r\n' % hdr) diff --git a/openstack_dashboard/dashboards/project/overview/tests.py b/openstack_dashboard/dashboards/project/overview/tests.py index e382488008..009ad6ce43 100644 --- a/openstack_dashboard/dashboards/project/overview/tests.py +++ b/openstack_dashboard/dashboards/project/overview/tests.py @@ -100,7 +100,7 @@ class UsageViewTests(test.TestCase): res = self.client.get(reverse('horizon:project:overview:index')) usages = res.context['usage'] self.assertTemplateUsed(res, 'project/overview/usage.html') - self.assertTrue(isinstance(usages, usage.ProjectUsage)) + self.assertIsInstance(usages, usage.ProjectUsage) self.assertEqual(nova_stu_enabled, res.context['simple_tenant_usage_enabled']) if nova_stu_enabled: @@ -184,7 +184,7 @@ class UsageViewTests(test.TestCase): res = self.client.get(reverse('horizon:project:overview:index') + "?format=csv") self.assertTemplateUsed(res, 'project/overview/usage.csv') - self.assertTrue(isinstance(res.context['usage'], usage.ProjectUsage)) + self.assertIsInstance(res.context['usage'], usage.ProjectUsage) def test_usage_exception_usage(self): self._stub_nova_api_calls(stu_exception=self.exceptions.nova) @@ -214,7 +214,7 @@ class UsageViewTests(test.TestCase): res = self.client.get(reverse('horizon:project:overview:index')) self.assertTemplateUsed(res, 'project/overview/usage.html') - self.assertTrue(isinstance(res.context['usage'], usage.ProjectUsage)) + self.assertIsInstance(res.context['usage'], usage.ProjectUsage) @test.update_settings(OPENSTACK_NEUTRON_NETWORK={'enable_quotas': True}) def test_usage_with_neutron(self): @@ -323,7 +323,7 @@ class UsageViewTests(test.TestCase): res = self.client.get(reverse('horizon:project:overview:index')) usages = res.context['usage'] self.assertTemplateUsed(res, 'project/overview/usage.html') - self.assertTrue(isinstance(usages, usage.ProjectUsage)) + self.assertIsInstance(usages, usage.ProjectUsage) if cinder_enabled: self.assertEqual(usages.limits['totalVolumesUsed'], 1) self.assertEqual(usages.limits['maxTotalVolumes'], 10) diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/tests.py b/openstack_dashboard/dashboards/project/volumes/volumes/tests.py index 219baf80a9..94c99507ff 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/tests.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/tests.py @@ -943,8 +943,8 @@ class VolumeViewTests(test.TestCase): self.assertEqual(len(form.fields['instance']._choices), 1) self.assertEqual(res.status_code, 200) - self.assertTrue(isinstance(form.fields['device'].widget, - widgets.TextInput)) + self.assertIsInstance(form.fields['device'].widget, + widgets.TextInput) self.assertFalse(form.fields['device'].required) @test.create_stubs({cinder: ('volume_get',), api.nova: ('server_list',)}) @@ -969,8 +969,8 @@ class VolumeViewTests(test.TestCase): args=[volume.id]) res = self.client.get(url) form = res.context['form'] - self.assertTrue(isinstance(form.fields['device'].widget, - widgets.TextInput)) + self.assertIsInstance(form.fields['device'].widget, + widgets.TextInput) self.assertFalse(form.fields['device'].required) @test.create_stubs({cinder: ('volume_get',), api.nova: ('server_list',)}) @@ -989,8 +989,8 @@ class VolumeViewTests(test.TestCase): res = self.client.get(url) # Assert the device field is hidden. form = res.context['form'] - self.assertTrue(isinstance(form.fields['device'].widget, - widgets.HiddenInput)) + self.assertIsInstance(form.fields['device'].widget, + widgets.HiddenInput) @test.create_stubs({cinder: ('volume_get',), api.nova: ('server_list',)})