Commit 0173ec07 authored by Rafael Monnerat's avatar Rafael Monnerat

Minor testing fixups

See merge request nexedi/slapos.core!444
parents 3bf365c0 d34d3844
...@@ -1876,9 +1876,14 @@ class TestSlapOSPerson_getSlapOSPendingTicket(TestCRMSkinsMixin): ...@@ -1876,9 +1876,14 @@ class TestSlapOSPerson_getSlapOSPendingTicket(TestCRMSkinsMixin):
class TestSlapOSPerson_getSlapOSPendingTicketMessageTemplate(TestCRMSkinsMixin): class TestSlapOSPerson_getSlapOSPendingTicketMessageTemplate(TestCRMSkinsMixin):
@simulate('NotificationTool_getDocumentValue',
'reference=None',
'assert reference == "slapos-crm-person-pending-ticket-notification"\n' \
'return None')
@simulate('Person_getSlapOSPendingTicket', '*args, **kwargs','return range(99)') @simulate('Person_getSlapOSPendingTicket', '*args, **kwargs','return range(99)')
def test_getSlapOSPendingTicketMessageTemplate(self): def test_getSlapOSPendingTicketMessageTemplate(self):
person = self.makePerson() person = self.makePerson()
# Test without notification message
title, message = person.Person_getSlapOSPendingTicketMessageTemplate() title, message = person.Person_getSlapOSPendingTicketMessageTemplate()
self.assertEqual(""" You have 99 pending tickets """, title) self.assertEqual(""" You have 99 pending tickets """, title)
self.assertEqual(""" You have 99 pending tickets """, message) self.assertEqual(""" You have 99 pending tickets """, message)
......
...@@ -1020,6 +1020,12 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin): ...@@ -1020,6 +1020,12 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin):
person = self._makePerson() person = self._makePerson()
base = self.portal.web_site_module.hostingjs base = self.portal.web_site_module.hostingjs
# On certain environments or sub-projects this value
# can be customized.
slapos_master_web_url = base.getLayoutProperty(
"configuration_slapos_master_web_url",
default=base.absolute_url())
self.login(person.getUserId()) self.login(person.getUserId())
token_dict = json.loads(base.Base_getComputeNodeToken()) token_dict = json.loads(base.Base_getComputeNodeToken())
...@@ -1029,7 +1035,7 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin): ...@@ -1029,7 +1035,7 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin):
self.assertEqual(token_dict['command_line'], "wget https://deploy.erp5.net/slapos ; bash slapos") self.assertEqual(token_dict['command_line'], "wget https://deploy.erp5.net/slapos ; bash slapos")
self.assertIn("%s-" % (DateTime().strftime("%Y%m%d")) , token_dict['access_token']) self.assertIn("%s-" % (DateTime().strftime("%Y%m%d")) , token_dict['access_token'])
self.assertEqual(token_dict['slapos_master_api'], "https://slap.vifib.com") self.assertEqual(token_dict['slapos_master_api'], "https://slap.vifib.com")
self.assertEqual(token_dict['slapos_master_web'], base.absolute_url()) self.assertEqual(token_dict['slapos_master_web'], slapos_master_web_url)
self.login() self.login()
token = self.portal.access_token_module[token_dict["access_token"]] token = self.portal.access_token_module[token_dict["access_token"]]
...@@ -1039,7 +1045,6 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin): ...@@ -1039,7 +1045,6 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin):
self.assertEqual(token.getAgentValue(), person) self.assertEqual(token.getAgentValue(), person)
self.assertEqual("One Time Restricted Access Token", token.getPortalType()) self.assertEqual("One Time Restricted Access Token", token.getPortalType())
class TestInstanceTree_edit(TestSlapOSHalJsonStyleMixin): class TestInstanceTree_edit(TestSlapOSHalJsonStyleMixin):
def afterSetUp(self): def afterSetUp(self):
......
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