Commit 7a85f1e3 authored by Rafael Monnerat's avatar Rafael Monnerat

Py3: assertEquals is deprecated ise assertEqual instead

parent c0853f7b
......@@ -690,7 +690,7 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
content_b = instance_b.workflow_history['edit_workflow'][-1]['comment']
# The alarm should group by project, so only one out of many should reached.
self.assertNotEquals(content_a, content_b)
self.assertNotEqual(content_a, content_b)
self.assertIn('Visited by %s' % script_name, [content_a, content_b])
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
......
......@@ -364,20 +364,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo_title', 'incoming', 'Letter',
'foo resource', 'foo text',
)
self.assertEquals(event.getPortalType(), 'Letter')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getSource(), ticket.getDestination())
self.assertEquals(event.getSourceSection(), ticket.getDestinationSection())
self.assertEquals(event.getSourceProject(), ticket.getDestinationProject())
self.assertEquals(event.getDestination(), ticket.getSource())
self.assertEquals(event.getDestinationSection(), ticket.getSourceSection())
self.assertEquals(event.getDestinationProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Letter')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getSource(), ticket.getDestination())
self.assertEqual(event.getSourceSection(), ticket.getDestinationSection())
self.assertEqual(event.getSourceProject(), ticket.getDestinationProject())
self.assertEqual(event.getDestination(), ticket.getSource())
self.assertEqual(event.getDestinationSection(), ticket.getSourceSection())
self.assertEqual(event.getDestinationProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'stopped')
self.assertEqual(event.getSimulationState(), 'stopped')
def test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotExistingNotificationMessage(self):
ticket = self.createUsualTicket()
......@@ -386,20 +386,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo resource', 'foo text',
notification_message='foo notification message'
)
self.assertEquals(event.getPortalType(), 'Letter')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getSource(), ticket.getDestination())
self.assertEquals(event.getSourceSection(), ticket.getDestinationSection())
self.assertEquals(event.getSourceProject(), ticket.getDestinationProject())
self.assertEquals(event.getDestination(), ticket.getSource())
self.assertEquals(event.getDestinationSection(), ticket.getSourceSection())
self.assertEquals(event.getDestinationProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Letter')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getSource(), ticket.getDestination())
self.assertEqual(event.getSourceSection(), ticket.getDestinationSection())
self.assertEqual(event.getSourceProject(), ticket.getDestinationProject())
self.assertEqual(event.getDestination(), ticket.getSource())
self.assertEqual(event.getDestinationSection(), ticket.getSourceSection())
self.assertEqual(event.getDestinationProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'stopped')
self.assertEqual(event.getSimulationState(), 'stopped')
def test_Ticket_createProjectEvent_incomingEventWithoutAttachmentAndNotificationMessage(self):
ticket = self.createUsualTicket()
......@@ -420,20 +420,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
notification_message=notification_message.getReference(),
language=notification_message.getLanguage()
)
self.assertEquals(event.getPortalType(), 'Letter')
self.assertEquals(event.getTitle(), notification_message.getTitle())
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getSource(), ticket.getDestination())
self.assertEquals(event.getSourceSection(), ticket.getDestinationSection())
self.assertEquals(event.getSourceProject(), ticket.getDestinationProject())
self.assertEquals(event.getDestination(), ticket.getSource())
self.assertEquals(event.getDestinationSection(), ticket.getSourceSection())
self.assertEquals(event.getDestinationProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), notification_message.getTextContent())
self.assertEquals(event.getContentType(), notification_message.getContentType())
self.assertEqual(event.getPortalType(), 'Letter')
self.assertEqual(event.getTitle(), notification_message.getTitle())
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getSource(), ticket.getDestination())
self.assertEqual(event.getSourceSection(), ticket.getDestinationSection())
self.assertEqual(event.getSourceProject(), ticket.getDestinationProject())
self.assertEqual(event.getDestination(), ticket.getSource())
self.assertEqual(event.getDestinationSection(), ticket.getSourceSection())
self.assertEqual(event.getDestinationProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), notification_message.getTextContent())
self.assertEqual(event.getContentType(), notification_message.getContentType())
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'stopped')
self.assertEqual(event.getSimulationState(), 'stopped')
def test_Ticket_createProjectEvent_incomingEventWithSourceAndDestination(self):
ticket = self.createUsualTicket()
......@@ -451,20 +451,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
source=source_value.getRelativeUrl(),
destination=destination_value.getRelativeUrl()
)
self.assertEquals(event.getPortalType(), 'Letter')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getSource(), source_value.getRelativeUrl())
self.assertEquals(event.getSourceSection(), ticket.getDestinationSection())
self.assertEquals(event.getSourceProject(), ticket.getDestinationProject())
self.assertEquals(event.getDestination(), destination_value.getRelativeUrl())
self.assertEquals(event.getDestinationSection(), ticket.getSourceSection())
self.assertEquals(event.getDestinationProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Letter')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getSource(), source_value.getRelativeUrl())
self.assertEqual(event.getSourceSection(), ticket.getDestinationSection())
self.assertEqual(event.getSourceProject(), ticket.getDestinationProject())
self.assertEqual(event.getDestination(), destination_value.getRelativeUrl())
self.assertEqual(event.getDestinationSection(), ticket.getSourceSection())
self.assertEqual(event.getDestinationProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'stopped')
self.assertEqual(event.getSimulationState(), 'stopped')
def test_Ticket_createProjectEvent_incomingEventWithAttachment(self):
ticket = self.createUsualTicket()
......@@ -473,24 +473,24 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo resource', 'foo text',
attachment=self.makeImageFileUpload()
)
self.assertEquals(event.getPortalType(), 'Web Message')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getSource(), ticket.getDestination())
self.assertEquals(event.getSourceSection(), ticket.getDestinationSection())
self.assertEquals(event.getSourceProject(), ticket.getDestinationProject())
self.assertEquals(event.getDestination(), ticket.getSource())
self.assertEquals(event.getDestinationSection(), ticket.getSourceSection())
self.assertEquals(event.getDestinationProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Web Message')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getSource(), ticket.getDestination())
self.assertEqual(event.getSourceSection(), ticket.getDestinationSection())
self.assertEqual(event.getSourceProject(), ticket.getDestinationProject())
self.assertEqual(event.getDestination(), ticket.getSource())
self.assertEqual(event.getDestinationSection(), ticket.getSourceSection())
self.assertEqual(event.getDestinationProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event, [{
"index": 2,
"content_type": "image/png",
"title": "erp5_logo.png"
}])
self.assertEquals(event.getSimulationState(), 'stopped')
self.assertEqual(event.getSimulationState(), 'stopped')
def test_Ticket_createProjectEvent_incomingEventWithAttachmentAndNotificationMessage(self):
ticket = self.createUsualTicket()
......@@ -509,20 +509,20 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
'foo_title', 'outgoing', 'Web Message',
'foo resource', 'foo text',
)
self.assertEquals(event.getPortalType(), 'Web Message')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getDestination(), ticket.getDestination())
self.assertEquals(event.getDestinationSection(), ticket.getDestinationSection())
self.assertEquals(event.getDestinationProject(), ticket.getDestinationProject())
self.assertEquals(event.getSource(), ticket.getSource())
self.assertEquals(event.getSourceSection(), ticket.getSourceSection())
self.assertEquals(event.getSourceProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Web Message')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getDestination(), ticket.getDestination())
self.assertEqual(event.getDestinationSection(), ticket.getDestinationSection())
self.assertEqual(event.getDestinationProject(), ticket.getDestinationProject())
self.assertEqual(event.getSource(), ticket.getSource())
self.assertEqual(event.getSourceSection(), ticket.getSourceSection())
self.assertEqual(event.getSourceProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'delivered')
self.assertEqual(event.getSimulationState(), 'delivered')
def test_Ticket_createProjectEvent_outgoingEventWithSourceAndDestination(self):
ticket = self.createUsualTicket()
......@@ -540,18 +540,18 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
source=source_value.getRelativeUrl(),
destination=destination_value.getRelativeUrl()
)
self.assertEquals(event.getPortalType(), 'Web Message')
self.assertEquals(event.getTitle(), 'foo_title')
self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEquals(event.getResource(), 'foo resource')
self.assertEquals(event.getDestination(), destination_value.getRelativeUrl())
self.assertEquals(event.getDestinationSection(), ticket.getDestinationSection())
self.assertEquals(event.getDestinationProject(), ticket.getDestinationProject())
self.assertEquals(event.getSource(), source_value.getRelativeUrl())
self.assertEquals(event.getSourceSection(), ticket.getSourceSection())
self.assertEquals(event.getSourceProject(), ticket.getSourceProject())
self.assertEquals(event.getTextContent(), 'foo text')
self.assertEquals(event.getContentType(), 'text/plain')
self.assertEqual(event.getPortalType(), 'Web Message')
self.assertEqual(event.getTitle(), 'foo_title')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getResource(), 'foo resource')
self.assertEqual(event.getDestination(), destination_value.getRelativeUrl())
self.assertEqual(event.getDestinationSection(), ticket.getDestinationSection())
self.assertEqual(event.getDestinationProject(), ticket.getDestinationProject())
self.assertEqual(event.getSource(), source_value.getRelativeUrl())
self.assertEqual(event.getSourceSection(), ticket.getSourceSection())
self.assertEqual(event.getSourceProject(), ticket.getSourceProject())
self.assertEqual(event.getTextContent(), 'foo text')
self.assertEqual(event.getContentType(), 'text/plain')
self.assertSameEventAttachmentList(event)
self.assertEquals(event.getSimulationState(), 'delivered')
self.assertEqual(event.getSimulationState(), 'delivered')
......@@ -123,7 +123,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.tic()
self.logout()
self.login()
self.assertEquals(instance_tree.getDestinationSection(),
self.assertEqual(instance_tree.getDestinationSection(),
public_person2.getRelativeUrl())
......@@ -136,8 +136,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid': subscription_change_request.getResourceUid(),
}
inventory_list = self.portal.portal_simulation.getCurrentInventoryList(**inventory_list_kw)
self.assertEquals(1, len(inventory_list))
self.assertEquals(0, inventory_list[0].total_quantity)
self.assertEqual(1, len(inventory_list))
self.assertEqual(0, inventory_list[0].total_quantity)
# Seller only sold 1 month
inventory_list_kw = {
......@@ -149,9 +149,9 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid': subscription_change_request.getResourceUid(),
}
inventory_list = self.portal.portal_simulation.getCurrentInventoryList(**inventory_list_kw)
self.assertEquals(1, len(inventory_list))
self.assertEqual(1, len(inventory_list))
# 2 - 0.42 (13 days of 31) - 0.1 (3 days of 31) + 1 - 0.83 (24 days of 29)
self.assertAlmostEquals(-1.65, inventory_list[0].total_quantity)
self.assertAlmostEqual(-1.65, inventory_list[0].total_quantity)
inventory_list_kw = {
'group_by_section': False,
......@@ -160,12 +160,12 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
'resource_uid': subscription_change_request.getResourceUid(),
}
inventory_list = self.portal.portal_simulation.getCurrentInventoryList(**inventory_list_kw)
self.assertEquals(3, len(inventory_list))
self.assertEqual(3, len(inventory_list))
# tracking_list = instance_tree.Item_getTrackingList()
# self.assertEquals(2, len(tracking_list))
# self.assertEqual(2, len(tracking_list))
# XXX TODO self.assertEquals(None, self.portal.portal_simulation.getInventoryList())
# XXX TODO self.assertEqual(None, self.portal.portal_simulation.getInventoryList())
# Ensure no unexpected object has been created
# 2 credential request
......@@ -246,13 +246,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.tic()
self.logout()
self.login()
self.assertEquals(new_trade_condition.getDestination(),
self.assertEqual(new_trade_condition.getDestination(),
owner_person.getRelativeUrl())
self.assertEquals(new_trade_condition.getDestinationSection(),
self.assertEqual(new_trade_condition.getDestinationSection(),
owner_organisation.getRelativeUrl())
self.assertEquals(new_trade_condition.getPortalType(),
self.assertEqual(new_trade_condition.getPortalType(),
'Sale Trade Condition')
self.assertEquals(subscription_request.getSimulationState(),
self.assertEqual(subscription_request.getSimulationState(),
'cancelled')
new_subscription_request = self.portal.portal_catalog.getResultValue(
......@@ -260,11 +260,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
aggregate__uid=project.getUid(),
simulation_state='submitted'
)
self.assertEquals(new_subscription_request.getDestination(),
self.assertEqual(new_subscription_request.getDestination(),
owner_person.getRelativeUrl())
self.assertEquals(new_subscription_request.getDestinationSection(),
self.assertEqual(new_subscription_request.getDestinationSection(),
owner_organisation.getRelativeUrl())
self.assertEquals(new_subscription_request.getSimulationState(),
self.assertEqual(new_subscription_request.getSimulationState(),
'submitted')
# If the script is called a second time,
......@@ -274,7 +274,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
new_subscription_request.getReference(),
None
)
self.assertEquals(new_subscription_request.getRelativeUrl(),
self.assertEqual(new_subscription_request.getRelativeUrl(),
new_subscription_request_2.getRelativeUrl())
# Ensure no unexpected object has been created
......@@ -367,13 +367,13 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.tic()
self.logout()
self.login()
self.assertEquals(new_trade_condition.getDestination(),
self.assertEqual(new_trade_condition.getDestination(),
owner_person.getRelativeUrl())
self.assertEquals(new_trade_condition.getDestinationSection(),
self.assertEqual(new_trade_condition.getDestinationSection(),
owner_organisation.getRelativeUrl())
self.assertEquals(new_trade_condition.getPortalType(),
self.assertEqual(new_trade_condition.getPortalType(),
'Sale Trade Condition')
self.assertEquals(subscription_request.getSimulationState(),
self.assertEqual(subscription_request.getSimulationState(),
'cancelled')
new_subscription_request = self.portal.portal_catalog.getResultValue(
......@@ -381,11 +381,11 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
aggregate__reference=compute_node_id,
simulation_state='submitted'
)
self.assertEquals(new_subscription_request.getDestination(),
self.assertEqual(new_subscription_request.getDestination(),
owner_person.getRelativeUrl())
self.assertEquals(new_subscription_request.getDestinationSection(),
self.assertEqual(new_subscription_request.getDestinationSection(),
owner_organisation.getRelativeUrl())
self.assertEquals(new_subscription_request.getSimulationState(),
self.assertEqual(new_subscription_request.getSimulationState(),
'submitted')
# If the script is called a second time,
......@@ -395,7 +395,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
new_subscription_request.getReference(),
None
)
self.assertEquals(new_subscription_request.getRelativeUrl(),
self.assertEqual(new_subscription_request.getRelativeUrl(),
new_subscription_request_2.getRelativeUrl())
# Ensure no unexpected object has been created
......
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