Skip to content

Commit

Permalink
Fixed deprecated assert functions in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Sep 9, 2020
1 parent de7e19d commit c0ca159
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plone/portlet/static/tests/test_portlet_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def setUp(self):

def testPortletTypeRegistered(self):
portlet = getUtility(IPortletType, name='plone.portlet.static.Static')
self.assertEquals(portlet.addview, 'plone.portlet.static.Static')
self.assertEqual(portlet.addview, 'plone.portlet.static.Static')

def testInterfaces(self):
portlet = static.Assignment(header=u"title", text="text")
self.failUnless(IPortletAssignment.providedBy(portlet))
self.failUnless(IPortletDataProvider.providedBy(portlet.data))
self.assertTrue(IPortletAssignment.providedBy(portlet))
self.assertTrue(IPortletDataProvider.providedBy(portlet.data))

def testInvokeAddview(self):
portlet = getUtility(IPortletType, name='plone.portlet.static.Static')
Expand All @@ -46,16 +46,16 @@ def testInvokeAddview(self):
data={'header': u"test title", 'text': u"test text"}
)

self.assertEquals(len(mapping), 1)
self.failUnless(isinstance(list(mapping.values())[0], static.Assignment))
self.assertEqual(len(mapping), 1)
self.assertTrue(isinstance(list(mapping.values())[0], static.Assignment))

def testInvokeEditView(self):
mapping = PortletAssignmentMapping()
request = self.portal.REQUEST

mapping['foo'] = static.Assignment(header=u"title", text="text")
editview = getMultiAdapter((mapping['foo'], request), name='edit')
self.failUnless(isinstance(editview, static.EditForm))
self.assertTrue(isinstance(editview, static.EditForm))

def testRenderer(self):
context = self.portal
Expand All @@ -72,9 +72,9 @@ def testRenderer(self):
(context, request, view, manager, assignment),
IPortletRenderer
)
self.failUnless(isinstance(renderer, static.Renderer))
self.assertTrue(isinstance(renderer, static.Renderer))

self.failUnless(renderer.available,
self.assertTrue(renderer.available,
"Renderer should be available by default.")


Expand Down Expand Up @@ -120,8 +120,8 @@ def test_render(self):
)
r.update()
output = r.render()
self.failUnless('title' in output)
self.failUnless('<b>text</b>' in output)
self.assertTrue('title' in output)
self.assertTrue('<b>text</b>' in output)

def test_no_header(self):
r = self.renderer(
Expand All @@ -144,7 +144,7 @@ def test_css_class(self):
text="<b>text</b>"
)
)
self.assertEquals('portlet-static-welcome-text', r.css_class())
self.assertEqual('portlet-static-welcome-text', r.css_class())

def test_relative_link(self):
r = self.renderer(
Expand Down

0 comments on commit c0ca159

Please sign in to comment.