Commit d18c8480 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

stop using deprecated aliases of TestCase methods.

see http://docs.python.org/2/library/unittest.html#deprecated-aliases
parent fa7113c9
......@@ -83,8 +83,8 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
response_dict = sequence.get("response_dict")
# configuration is finished. We are at the Install state.
# On maxma demo, installation is the first slide.
self.assertEquals('show', response_dict['command'])
self.assertEquals('Install', response_dict['next'])
self.assertEqual('show', response_dict['command'])
self.assertEqual('Install', response_dict['next'])
def stepSetMaxmaDemoWorkflow(self, sequence=None, sequence_list=None, **kw):
""" Set Consulting Workflow into Business Configuration """
......@@ -130,7 +130,7 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
# Check Gadgets
for gadget in self.portal.portal_gadgets.searchFolder():
self.assertEquals('public', gadget.getValidationState(),
self.assertEqual('public', gadget.getValidationState(),
"%s is not public but %s" % (gadget.getRelativeUrl(),
gadget.getValidationState()))
gadget.Base_checkConsistency()
......@@ -140,11 +140,11 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
reference=self.user_reference)
self.assertNotEquals(user.Person_getAvailableAssignmentValueList(), [])
self.assertEquals(user.getTitle(), "Jack Vale")
self.assertEquals(user.getValidationState(), "validated")
self.assertEquals(user.getSubordination(),
self.assertEqual(user.getTitle(), "Jack Vale")
self.assertEqual(user.getValidationState(), "validated")
self.assertEqual(user.getSubordination(),
'organisation_module/myorganisation')
self.assertEquals(user.getSubordinationTitle(), "Maxma Co")
self.assertEqual(user.getSubordinationTitle(), "Maxma Co")
### STEPS
DEFAULT_SEQUENCE_LIST = """
......
30
\ No newline at end of file
31
\ No newline at end of file
......@@ -114,13 +114,13 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
""" Check if organisation was created fine """
business_configuration = sequence.get("business_configuration")
organisation_config_save = business_configuration['3']
self.assertEquals(organisation_config_save.getTitle(),
self.assertEqual(organisation_config_save.getTitle(),
"My Organisation")
self.assertEquals(1, len(organisation_config_save.contentValues()))
self.assertEqual(1, len(organisation_config_save.contentValues()))
organisation_config_item = organisation_config_save['1']
self.assertEquals(organisation_config_item.getPortalType(),
self.assertEqual(organisation_config_item.getPortalType(),
'Organisation Configurator Item')
self.assertEquals(organisation_config_item.getDefaultEmailText(),
self.assertEqual(organisation_config_item.getDefaultEmailText(),
'me@example.com')
def stepSetupUserAccountNumberThree(self, sequence=None, sequence_list=None, **kw):
......@@ -140,9 +140,9 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
""" Check the multiple user account form """
response_dict = sequence.get("response_dict")
if 'command' in response_dict:
self.assertEquals('show', response_dict['command'])
self.assertEquals('Previous', response_dict['previous'])
self.assertEquals('Configure ERP5 Preferences', response_dict['next'])
self.assertEqual('show', response_dict['command'])
self.assertEqual('Previous', response_dict['previous'])
self.assertEqual('Configure ERP5 Preferences', response_dict['next'])
self.assertCurrentStep('RunMyDoc Preferences', response_dict)
def stepSetupPreferenceConfigurationBrazil(self, sequence=None, sequence_list=None, **kw):
......@@ -166,30 +166,30 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
business_configuration = sequence.get("business_configuration")
person_config_save = business_configuration["5"]
person_config_item = person_config_save["1"]
self.assertEquals(person_config_item.getReference(), "person_creator")
self.assertEqual(person_config_item.getReference(), "person_creator")
person_config_item = person_config_save["2"]
self.assertEquals(person_config_item.getReference(), "person_assignee")
self.assertEqual(person_config_item.getReference(), "person_assignee")
person_config_item = person_config_save["3"]
self.assertEquals(person_config_item.getReference(), "person_assignor")
self.assertEqual(person_config_item.getReference(), "person_assignor")
def stepCheckMultipleUserAccountThreeFrance(self, sequence=None, sequence_list=None, **kw):
""" Check if the users were created correctly """
business_configuration = sequence.get("business_configuration")
person_config_save = business_configuration["5"]
person_config_item = person_config_save["1"]
self.assertEquals(person_config_item.getReference(), "french_creator")
self.assertEqual(person_config_item.getReference(), "french_creator")
person_config_item = person_config_save["2"]
self.assertEquals(person_config_item.getReference(), "french_assignee")
self.assertEqual(person_config_item.getReference(), "french_assignee")
person_config_item = person_config_save["3"]
self.assertEquals(person_config_item.getReference(), "french_assignor")
self.assertEqual(person_config_item.getReference(), "french_assignor")
def stepCheckSystemPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw):
""" Check System Preference"""
system_preference = self.portal.portal_catalog.getResultValue(portal_type="System Preference")
conversion_dict = _getConversionServerDict()
self.assertEquals(system_preference.getPreferredOoodocServerPortNumber(),
self.assertEqual(system_preference.getPreferredOoodocServerPortNumber(),
conversion_dict['port'])
self.assertEquals(system_preference.getPreferredOoodocServerAddress(),
self.assertEqual(system_preference.getPreferredOoodocServerAddress(),
conversion_dict['hostname'])
def stepCheckUserPreferenceAfterInstallation(self, sequence=None, sequence_list=None, **kw):
......@@ -197,13 +197,13 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
portal_catalog = self.portal.portal_catalog
preference = portal_catalog.getResultValue(portal_type="Preference",
title='Preference for Person Assignor')
self.assertEquals(preference.getPreferenceState(), "enabled")
self.assertEqual(preference.getPreferenceState(), "enabled")
preference = portal_catalog.getResultValue(portal_type="Preference",
title='Preference for Person Assignee')
self.assertEquals(preference.getPreferenceState(), "enabled")
self.assertEqual(preference.getPreferenceState(), "enabled")
preference = portal_catalog.getResultValue(portal_type="Preference",
title='Preference for Person Creator')
self.assertEquals(preference.getPreferenceState(), "enabled")
self.assertEqual(preference.getPreferenceState(), "enabled")
def _stepCheckKnowledgePadRole(self):
""" Check if Knowledge Pad is configured correctly """
......@@ -216,10 +216,10 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
self.portal.KnowledgePad_addBoxList(uids=[gadget_uid],
active_pad_relative_url=pad.getRelativeUrl())
self.tic()
self.assertEquals(len(pad.contentValues()), 1)
self.assertEqual(len(pad.contentValues()), 1)
box = pad.contentValues()[0]
self.assertEquals(box.getValidationState(), 'visible')
self.assertEquals(box.getSpecialise(), 'portal_gadgets/test_wizard_gadget')
self.assertEqual(box.getValidationState(), 'visible')
self.assertEqual(box.getSpecialise(), 'portal_gadgets/test_wizard_gadget')
class TestRunMyDocsConfiguratorWorkflowFranceLanguage(TestRunMyDocsConfiguratorWorkflowMixin):
"""
......
12
\ No newline at end of file
13
\ No newline at end of file
668
\ No newline at end of file
669
\ No newline at end of file
62
\ No newline at end of file
63
\ No newline at end of file
......@@ -344,10 +344,10 @@ class TestEGovMixin(SecurityTestCase):
self.portal,
workflow_list=['egov_universal_workflow', 'egov_anonymous_workflow'])
self.assertNotEquals(worklist_dict, {})
self.assertEquals(worklist_dict.has_key(portal_type), True)
self.assertEqual(worklist_dict.has_key(portal_type), True)
portal_type_dict = worklist_dict[portal_type]
self.assertEquals(portal_type_dict.has_key(validation_state), True)
self.assertEquals(portal_type_dict[validation_state]['count'], count)
self.assertEqual(portal_type_dict.has_key(validation_state), True)
self.assertEqual(portal_type_dict[validation_state]['count'], count)
# relog with previous user
if previous_user in ('Anonymous User', 'ERP5TypeTestCase'):
......
765
\ No newline at end of file
766
\ No newline at end of file
......@@ -70,16 +70,16 @@ class TestDiscussionThread(SecurityTestCase):
thread_posts = thread.objectValues()
# thread should have only one post
self.assertEquals(len(thread_posts), 1)
self.assertEqual(len(thread_posts), 1)
# that unique post should have the right content
self.assertEquals(thread_posts[0].getTextContent(), thread_content)
self.assertEqual(thread_posts[0].getTextContent(), thread_content)
# Check that the thread is inserted in the forum module
self.assertEquals(thread.getParentValue().getRelativeUrl(), self.forum_module.getRelativeUrl())
self.assertEqual(thread.getParentValue().getRelativeUrl(), self.forum_module.getRelativeUrl())
# the thread should have been published
self.assertEquals(thread.getValidationState(), 'public')
self.assertEqual(thread.getValidationState(), 'public')
reply_content='Can we add a reply?'
post = thread.DiscussionThreadModule_addReply(
......@@ -98,10 +98,10 @@ class TestDiscussionThread(SecurityTestCase):
# original thread and reply:
# thread should have two posts
self.assertEquals(len(thread_posts), 2)
self.assertEqual(len(thread_posts), 2)
# Check that post was inserted in thread
self.assertEquals(post.getParentValue().getRelativeUrl(), thread.getRelativeUrl())
self.assertEqual(post.getParentValue().getRelativeUrl(), thread.getRelativeUrl())
def testSpyCannotAccessButVisitorCan(self):
"""
......@@ -131,7 +131,7 @@ class TestDiscussionThread(SecurityTestCase):
(self.portal.getId(), thread.getRelativeUrl()),
'visitor:visitor'
)
self.assertEquals(response.getStatus(), HTTP_OK)
self.assertEqual(response.getStatus(), HTTP_OK)
def testVisitorCannotPost(self):
"""
......@@ -201,4 +201,4 @@ class TestDiscussionThread(SecurityTestCase):
(self.portal.getId(), thread.getRelativeUrl()),
'another_forum_user:another_forum_user'
)
self.assertEquals(response.getStatus(), HTTP_OK)
self.assertEqual(response.getStatus(), HTTP_OK)
9
\ No newline at end of file
10
\ No newline at end of file
......@@ -109,9 +109,9 @@ class TestIngestion(ERP5TypeLiveTestCase):
filename = 'any_file.txt'
document = self.contributeFileWithUrl(script_id, filename=filename)
self.tic()
self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), filename)
self.assertEquals(document.getContentType(), 'text/plain')
self.assertEqual(document.getPortalType(), 'Text')
self.assertEqual(document.getFilename(), filename)
self.assertEqual(document.getContentType(), 'text/plain')
self.assertTrue(document.hasData())
def test_02_contributeTextFileWithExplicitExtensionfromUrl(self):
......@@ -122,9 +122,9 @@ class TestIngestion(ERP5TypeLiveTestCase):
script_id = 'ERP5Site_getTextFile.txt'
document = self.contributeFileWithUrl(script_id)
self.tic()
self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), script_id)
self.assertEquals(document.getContentType(), 'text/plain')
self.assertEqual(document.getPortalType(), 'Text')
self.assertEqual(document.getFilename(), script_id)
self.assertEqual(document.getContentType(), 'text/plain')
self.assertTrue(document.hasData())
def test_03_textFileWithExplicitExtensionWithoutContentTypefromUrl(self):
......@@ -134,9 +134,9 @@ class TestIngestion(ERP5TypeLiveTestCase):
script_id = 'ERP5Site_getTextFileWithoutContentType.txt'
document = self.contributeFileWithUrl(script_id)
self.tic()
self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), script_id)
self.assertEquals(document.getContentType(), 'text/plain')
self.assertEqual(document.getPortalType(), 'Text')
self.assertEqual(document.getFilename(), script_id)
self.assertEqual(document.getContentType(), 'text/plain')
self.assertTrue(document.hasData())
def test_04_contributeTextFileWithFilenameAndRedirectionfromUrl(self):
......@@ -147,9 +147,9 @@ class TestIngestion(ERP5TypeLiveTestCase):
filename = 'any_file.txt'
document = self.contributeFileWithUrl(script_id, filename=filename)
self.tic()
self.assertEquals(document.getPortalType(), 'Text')
self.assertEquals(document.getFilename(), filename)
self.assertEquals(document.getContentType(), 'text/plain')
self.assertEqual(document.getPortalType(), 'Text')
self.assertEqual(document.getFilename(), filename)
self.assertEqual(document.getContentType(), 'text/plain')
self.assertTrue(document.hasData())
def test_05_contributeTextFileWithoutFilenameButHTMLContentType(self):
......@@ -160,8 +160,8 @@ class TestIngestion(ERP5TypeLiveTestCase):
script_id = 'ERP5Site_getTextFileWithoutFileNameButHTMLContentType'
document = self.contributeFileWithUrl(script_id)
self.tic()
self.assertEquals(document.getPortalType(), 'Web Page')
self.assertEquals(document.getFilename(), script_id)
self.assertEquals(document.getContentType(), 'text/html')
self.assertEqual(document.getPortalType(), 'Web Page')
self.assertEqual(document.getFilename(), script_id)
self.assertEqual(document.getContentType(), 'text/html')
self.assertTrue(document.hasData())
151
\ No newline at end of file
152
\ No newline at end of file
......@@ -84,7 +84,7 @@ business=<tal:block tal:replace='here/service_username'/>
}
try:
result = self.service.navigate(page_template=pt_id, paypal_dict=paypal_dict)
self.assertEquals(result, """key=return value=http://ipn/
self.assertEqual(result, """key=return value=http://ipn/
link=http://paypal/
business=business@sample.com""")
finally:
......
10
\ No newline at end of file
11
\ No newline at end of file
......@@ -87,8 +87,8 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
def getDataResult(result):
data_list = []
column_id_list = [x[0] for x in result.column_list]
self.assertEquals(column_id_list[0], "source_title")
self.assertEquals(column_id_list[-1], "total")
self.assertEqual(column_id_list[0], "source_title")
self.assertEqual(column_id_list[-1], "total")
column_id_list.pop(0)
column_id_list.pop(-1)
column_id_list.sort()
......@@ -108,7 +108,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
at_date = DateTime("2014/01/01")
result = callReport()
# Initially we should have only one line for an empty total
self.assertEquals((["Worker", "Total"],
self.assertEqual((["Worker", "Total"],
[["Total", None]]),
getDataResult(result))
......@@ -119,7 +119,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
source='person_module/Person_1',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Total"],
self.assertEqual((["Worker", "undefined", "Total"],
[["Person_1", 3, 3],
["Total", 3, 3]]),
getDataResult(result))
......@@ -132,7 +132,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
line_aggregate_relative_url='research_item_module/Item_1',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Item_1", "Total"],
self.assertEqual((["Worker", "undefined", "Item_1", "Total"],
[["Person_1", 3, None, 3],
["Person_2", None, 5.2, 5.2],
["Total", 3, 5.2, 8.2]]),
......@@ -158,7 +158,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
line_aggregate_relative_url='research_item_module/Item_2',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Item_1", "Item_2", "Total"],
self.assertEqual((["Worker", "undefined", "Item_1", "Item_2", "Total"],
[["Person_1", 3, None, 1.7, 4.7],
["Person_2", None, 7.6, 0.9, 8.5],
["Total", 3, 7.6, 2.6, 13.2]]),
......
8
\ No newline at end of file
9
\ No newline at end of file
......@@ -88,7 +88,7 @@ class TestRunMyDoc(ERP5TypeTestCase):
document = website.WebSection_getDocumentValue(test_page_reference)
self.assertNotEquals(None, document)
self.assertEquals(document.getRelativeUrl(),
self.assertEqual(document.getRelativeUrl(),
test_page.getRelativeUrl())
def test_Zuite_uploadScreenShot(self):
......@@ -127,15 +127,15 @@ class TestRunMyDoc(ERP5TypeTestCase):
self.assertNotEquals(None,
self.portal.Zuite_uploadScreenshot(image_upload, web_page_reference))
self.assertEquals(None,
self.assertEqual(None,
self.portal.Zuite_uploadScreenshot(image_upload, image_reference))
self.tic()
# The right image were updated.
image_upload.seek(0)
self.assertEquals(image_page_2.getData(), image_upload.read().decode("base64"))
self.assertEquals(image_page_2.getFilename(), image_reference + '.png')
self.assertEquals(image_page.getData(), '')
self.assertEqual(image_page_2.getData(), image_upload.read().decode("base64"))
self.assertEqual(image_page_2.getFilename(), image_reference + '.png')
self.assertEqual(image_page.getData(), '')
def test_viewSeleniumTest(self):
"""
......@@ -226,7 +226,7 @@ class TestRunMyDoc(ERP5TypeTestCase):
test_page = self.portal.test_page_module.newContent(title="TEST",
reference='TESTPAGEREFERENCE',
text_content=test_page_html)
self.assertEquals(test_page.TestPage_viewSeleniumTest(), expected_test_html %
self.assertEqual(test_page.TestPage_viewSeleniumTest(), expected_test_html %
("ERP5TypeTestCase", ""))
self.tic()
......@@ -240,7 +240,7 @@ class TestRunMyDoc(ERP5TypeTestCase):
expected_html = expected_test_html % ("ERP5TypeTestCase", "")
self.assertEquals(zptest._text, expected_html.strip())
self.assertEqual(zptest._text, expected_html.strip())
expected_test_html = u"""<html>
<head>
......@@ -301,7 +301,7 @@ class TestRunMyDoc(ERP5TypeTestCase):
self.portal.REQUEST['user'] = "toto"
self.portal.REQUEST['password'] = "toto"
self.assertEquals(test_page.TestPage_viewSeleniumTest(REQUEST=self.portal.REQUEST),
self.assertEqual(test_page.TestPage_viewSeleniumTest(REQUEST=self.portal.REQUEST),
expected_test_html % ("http://toto.com", "toto", "toto"))
self.tic()
test_page.TestPage_runSeleniumTest()
......@@ -314,4 +314,4 @@ class TestRunMyDoc(ERP5TypeTestCase):
expected_html = expected_test_html % ("http://toto.com", "toto", "toto")
self.assertEquals(zptest._text, expected_html.strip())
self.assertEqual(zptest._text, expected_html.strip())
69
\ No newline at end of file
70
\ No newline at end of file
......@@ -99,20 +99,20 @@ class TestSafeImage(ERP5TypeTestCase):
self.tic()
self.assertNotEqual(tile,None)
image_property = getattr(tile, "ImageProperties.xml", None)
self.assertEquals(image_property.getData(),
self.assertEqual(image_property.getData(),
"""<IMAGE_PROPERTIES WIDTH="660" HEIGHT="495" NUMTILES="9" NUMIMAGES="1" VERSION="1.8" TILESIZE="256" />""")
self.assertNotEqual(image_property, None)
self.assertEquals("Embedded File", image_property.getPortalType())
self.assertEqual("Embedded File", image_property.getPortalType())
image_group = getattr(tile, "TileGroup0", None)
self.assertNotEquals(image_group, None)
self.assertEquals("Image Tile Group",image_group.getPortalType())
self.assertEqual("Image Tile Group",image_group.getPortalType())
splitted_image_list = image_group.objectValues(portal_type="Image")
self.assertEquals(set(['0-0-0','1-0-0','1-1-0','2-0-0','2-0-1','2-1-0','2-1-1','2-2-0','2-2-1']),
self.assertEqual(set(['0-0-0','1-0-0','1-1-0','2-0-0','2-0-1','2-1-0','2-1-1','2-2-0','2-2-1']),
set([x.getId() for x in splitted_image_list]))
for x in splitted_image_list:
self.assertTrue(x.hasData())
self.assertEquals(123,image_group['0-0-0'].getHeight())
self.assertEquals(165,image_group['0-0-0'].getWidth())
self.assertEqual(123,image_group['0-0-0'].getHeight())
self.assertEqual(165,image_group['0-0-0'].getWidth())
def test_03_CreateTileImageTransformed(self):
""""
......@@ -129,24 +129,24 @@ class TestSafeImage(ERP5TypeTestCase):
self.tic()
self.assertNotEqual(tile_transformed,None)
image_property = getattr(tile_transformed, "ImageProperties.xml", None)
self.assertEquals(image_property.getData(),
self.assertEqual(image_property.getData(),
"""<IMAGE_PROPERTIES WIDTH="660" HEIGHT="495" NUMTILES="9" NUMIMAGES="1" VERSION="1.8" TILESIZE="256" />""")
self.assertNotEqual(image_property, None)
self.assertEquals("Embedded File", image_property.getPortalType())
self.assertEqual("Embedded File", image_property.getPortalType())
image_transform = getattr(tile_transformed, "TransformFile.txt", None)
self.assertTrue(image_transform.getData().split()[1],'2-0-0')
self.assertNotEqual(image_transform, None)
self.assertEquals("Embedded File", image_transform.getPortalType())
self.assertEqual("Embedded File", image_transform.getPortalType())
image_group = getattr(tile_transformed, "TileGroup0", None)
self.assertNotEquals(image_group, None)
self.assertEquals("Image Tile Group",image_group.getPortalType())
self.assertEqual("Image Tile Group",image_group.getPortalType())
splitted_image_list = image_group.objectValues(portal_type="Image")
self.assertEquals(set(['0-0-0','1-0-0','1-1-0','2-0-0','2-0-1','2-1-0','2-1-1','2-2-0','2-2-1']),
self.assertEqual(set(['0-0-0','1-0-0','1-1-0','2-0-0','2-0-1','2-1-0','2-1-1','2-2-0','2-2-1']),
set([x.getId() for x in splitted_image_list]))
for x in splitted_image_list:
self.assertTrue(x.hasData())
self.assertEquals(123,image_group['0-0-0'].getHeight())
self.assertEquals(165,image_group['0-0-0'].getWidth())
self.assertEqual(123,image_group['0-0-0'].getHeight())
self.assertEqual(165,image_group['0-0-0'].getWidth())
if getattr(self.image_module,'testTileTransformed',None) is not None:
self.image_module.manage_delObjects(ids=['testTileTransformed'])
transaction.commit()
......
15
\ No newline at end of file
16
\ No newline at end of file
......@@ -57,18 +57,18 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
self.tic()
def test_getChildCount(self):
self.assertEquals(0, self.person_1.Person_getChildCount())
self.assertEqual(0, self.person_1.Person_getChildCount())
self.person_2.setNaturalParentValue(self.person_1)
self.tic()
self.assertEquals(1, self.person_1.Person_getChildCount())
self.assertEqual(1, self.person_1.Person_getChildCount())
self.assertEquals(1, self.person_1.Person_getChildCount(max_age=1000))
self.assertEquals(0, self.person_1.Person_getChildCount(max_age=2))
self.assertEqual(1, self.person_1.Person_getChildCount(max_age=1000))
self.assertEqual(0, self.person_1.Person_getChildCount(max_age=2))
def test_SocialContract(self):
self.assertEquals(0, self.person_1.Person_getPartnerCount())
self.assertEqual(0, self.person_1.Person_getPartnerCount())
contract_1 = self.portal.social_contract_module.newContent(
portal_type='Social Contract',
social_contract_type='marriage',
......@@ -76,7 +76,7 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
contract_1.setDestinationValueList((self.person_1, self.person_2))
contract_1.validate()
self.tic()
self.assertEquals(1, self.person_1.Person_getPartnerCount())
self.assertEqual(1, self.person_1.Person_getPartnerCount())
contract_2 = self.portal.social_contract_module.newContent(
portal_type='Social Contract',
......@@ -86,19 +86,19 @@ class TestERP5SocialContracts(ERP5TypeTestCase):
contract_2.validate()
self.tic()
self.assertEquals(2, self.person_1.Person_getPartnerCount())
self.assertEqual(2, self.person_1.Person_getPartnerCount())
# you can specify a date
self.assertEquals(1,
self.assertEqual(1,
self.person_1.Person_getPartnerCount(at_date=DateTime(3000, 1, 2)))
# you can restrict to some social contracts types only
self.assertEquals(1, self.person_1.Person_getPartnerCount(
self.assertEqual(1, self.person_1.Person_getPartnerCount(
valid_social_contract_type_list=('marriage', )))
# only validated social contracts are used
contract_1.invalidate()
self.assertEquals(1, self.person_1.Person_getPartnerCount())
self.assertEqual(1, self.person_1.Person_getPartnerCount())
def test_suite():
......
29
\ No newline at end of file
30
\ No newline at end of file
......@@ -92,11 +92,11 @@ class TestTaskDistribution(ERP5TypeTestCase):
def test_01_createTestNode(self):
test_node = self._createTestNode()[0]
self.assertEquals(test_node.getPortalType(), "Test Node")
self.assertEqual(test_node.getPortalType(), "Test Node")
def test_02_createTestSuite(self):
test_suite, = self._createTestSuite()
self.assertEquals(test_suite.getPortalType(), "Test Suite")
self.assertEqual(test_suite.getPortalType(), "Test Suite")
def _callOptimizeAlarm(self):
self.portal.portal_alarms.task_distributor_alarm_optimize.activeSense()
......@@ -105,14 +105,14 @@ class TestTaskDistribution(ERP5TypeTestCase):
def test_03_startTestSuiteWithOneTestNode(self):
config_list = json.loads(self.distributor.startTestSuite(
title="COMP32-Node1"))
self.assertEquals([], config_list)
self.assertEqual([], config_list)
self._createTestSuite(quantity=3)
self.tic()
self._callOptimizeAlarm()
config_list =