Commit 2c614cd2 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Add tests for slapos_crm_check_software_installation_state

parent a258f253
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:1105, 0: Cannot decode using encoding "ascii", unexpected byte at position 32 (invalid-encoded-data)</string> <string>W:1145, 0: Cannot decode using encoding "ascii", unexpected byte at position 32 (invalid-encoded-data)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -434,8 +434,8 @@ The slapos team ...@@ -434,8 +434,8 @@ The slapos team
ticket, event = person.Person_checkToCreateRegularisationRequest() ticket, event = person.Person_checkToCreateRegularisationRequest()
transaction.commit() transaction.commit()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEqual(ticket, None) self.assertNotEquals(ticket, None)
self.assertNotEqual(event, None) self.assertNotEquals(event, None)
self.assertEqual(ticket2, None) self.assertEqual(ticket2, None)
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -456,8 +456,8 @@ The slapos team ...@@ -456,8 +456,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEqual(ticket, None) self.assertNotEquals(ticket, None)
self.assertNotEqual(event, None) self.assertNotEquals(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -469,8 +469,8 @@ The slapos team ...@@ -469,8 +469,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEqual(ticket, None) self.assertNotEquals(ticket, None)
self.assertNotEqual(event, None) self.assertNotEquals(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -482,8 +482,8 @@ The slapos team ...@@ -482,8 +482,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertNotEquals(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertNotEqual(event2, None) self.assertNotEquals(event2, None)
def test_addRegularisationRequest_REQUEST_disallowed(self): def test_addRegularisationRequest_REQUEST_disallowed(self):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
...@@ -634,7 +634,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -634,7 +634,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment') 'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
self.assertEqual(ticket.getResource(), 'foo/bar') self.assertEqual(ticket.getResource(), 'foo/bar')
self.assertNotEqual(event.getTitle(), 'foo2 title') self.assertNotEquals(event.getTitle(), 'foo2 title')
self.assertEqual(event.getTextContent(), None) self.assertEqual(event.getTextContent(), None)
self.assertEqual(event.getSimulationState(), 'draft') self.assertEqual(event.getSimulationState(), 'draft')
self.assertEqual(event.getRelativeUrl(), event2.getRelativeUrl()) self.assertEqual(event.getRelativeUrl(), event2.getRelativeUrl())
...@@ -666,7 +666,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -666,7 +666,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
transaction.commit() transaction.commit()
event2 = ticket.RegularisationRequest_checkToSendUniqEvent( event2 = ticket.RegularisationRequest_checkToSendUniqEvent(
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment') 'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
self.assertNotEqual(event, event2) self.assertNotEquals(event, event2)
self.assertEqual(event2, None) self.assertEqual(event2, None)
def test_checkToSendUniqEvent_REQUEST_disallowed(self): def test_checkToSendUniqEvent_REQUEST_disallowed(self):
...@@ -1956,7 +1956,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin): ...@@ -1956,7 +1956,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin):
self.tic() self.tic()
self.assertEqual(computer.getAllocationScope(), 'open/personal') self.assertEqual(computer.getAllocationScope(), 'open/personal')
#ticket = self._getGeneratedSupportRequest(computer) #ticket = self._getGeneratedSupportRequest(computer)
self.assertNotEqual(None, ticket) self.assertNotEquals(None, ticket)
self.assertEqual(ticket.getSimulationState(), 'suspended') self.assertEqual(ticket.getSimulationState(), 'suspended')
self.assertEqual('Visited by SupportRequest_trySendNotificationMessage ' \ self.assertEqual('Visited by SupportRequest_trySendNotificationMessage ' \
...@@ -3116,7 +3116,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -3116,7 +3116,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, first_event.getTitle()) self.assertEqual(title, first_event.getTitle())
self.assertEqual(text_content, first_event.getTextContent()) self.assertEqual(text_content, first_event.getTextContent())
self.assertNotEqual(None, first_event.getStartDate()) self.assertNotEquals(None, first_event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
first_event.getResource()) first_event.getResource())
self.assertEqual(first_event.getDestination(), person.getRelativeUrl()) self.assertEqual(first_event.getDestination(), person.getRelativeUrl())
...@@ -3130,7 +3130,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -3130,7 +3130,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, event.getTitle()) self.assertEqual(title, event.getTitle())
self.assertEqual(text_content, event.getTextContent()) self.assertEqual(text_content, event.getTextContent())
self.assertNotEqual(None, event.getStartDate()) self.assertNotEquals(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
event.getResource()) event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl()) self.assertEqual(event.getDestination(), person.getRelativeUrl())
...@@ -3143,7 +3143,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -3143,7 +3143,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(event.getTitle(), title) self.assertEqual(event.getTitle(), title)
self.assertEqual(text_content, event.getTextContent()) self.assertEqual(text_content, event.getTextContent())
self.assertNotEqual(None, event.getStartDate()) self.assertNotEquals(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
event.getResource()) event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl()) self.assertEqual(event.getDestination(), person.getRelativeUrl())
...@@ -3168,7 +3168,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -3168,7 +3168,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, another_first_event.getTitle()) self.assertEqual(title, another_first_event.getTitle())
self.assertEqual(text_content, another_first_event.getTextContent()) self.assertEqual(text_content, another_first_event.getTextContent())
self.assertNotEqual(None, another_first_event.getStartDate()) self.assertNotEquals(None, another_first_event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
another_first_event.getResource()) another_first_event.getResource())
self.assertEqual(another_first_event.getDestination(), person.getRelativeUrl()) self.assertEqual(another_first_event.getDestination(), person.getRelativeUrl())
......
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