Commit abd99c6f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: No more Friends

parent 378cdef3
Pipeline #17959 failed with stage
in 0 seconds
......@@ -76,23 +76,17 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
person = self.makePerson()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_public(
self._test_ComputeNode_setAllocationScope_public(
source_administration=person.getRelativeUrl())
self.assertEqual(compute_node.getSubjectList(), [''])
self.assertEqual(compute_node.getDestinationSection(), None)
def test_ComputeNode_setAllocationScope_subscription_with_source_adm(self):
person = self.makePerson()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_public(
self._test_ComputeNode_setAllocationScope_public(
source_administration=person.getRelativeUrl(),
allocation_scope="open/subscription")
self.assertEqual(compute_node.getSubjectList(), [''])
self.assertEqual(compute_node.getDestinationSection(), None)
def _test_ComputeNode_setAllocationScope_personal(self,
upgrade_scope=None,
......@@ -103,8 +97,6 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
monitor_scope=None,
upgrade_scope=upgrade_scope,
source_administration=source_administration)
if subject_list:
compute_node.setSubjectList(subject_list)
self.commit()
compute_node.edit(allocation_scope='open/personal')
......@@ -116,22 +108,16 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
def test_ComputeNode_setAllocationScope_personal(self):
compute_node = self._test_ComputeNode_setAllocationScope_personal()
self.assertEqual(compute_node.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(compute_node.getSubjectList(), [])
self.assertEqual(compute_node.getDestinationSection(), None)
def test_ComputeNode_setAllocationScope_personal_upgrade_disabled(self):
compute_node = self._test_ComputeNode_setAllocationScope_personal(
upgrade_scope="disabled")
self.assertEqual(compute_node.getUpgradeScope(), 'disabled')
self.assertEqual(compute_node.getSubjectList(), [])
self.assertEqual(compute_node.getDestinationSection(), None)
def test_ComputeNode_setAllocationScope_personal_upgrade_auto(self):
compute_node = self._test_ComputeNode_setAllocationScope_personal(
upgrade_scope="auto")
self.assertEqual(compute_node.getUpgradeScope(), 'auto')
self.assertEqual(compute_node.getSubjectList(), [])
self.assertEqual(compute_node.getDestinationSection(), None)
def test_ComputeNode_setAllocationScope_personal_with_source_adm(self):
person = self.makePerson()
......@@ -142,9 +128,6 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
source_administration=person.getRelativeUrl(),
)
self.assertEqual(compute_node.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_ComputeNode_setAllocationScope_personal_with_subject_list(self):
person = self.makePerson()
......@@ -156,9 +139,6 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
subject_list=["some@example.com"]
)
self.assertEqual(compute_node.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
def _test_ComputeNode_setAllocationScope_closed(self,
upgrade_scope=None,
......@@ -170,8 +150,7 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
monitor_scope=None,
upgrade_scope=upgrade_scope,
source_administration=source_administration)
if subject_list:
compute_node.setSubjectList(subject_list)
self.commit()
compute_node.edit(allocation_scope=allocation_scope)
......@@ -190,13 +169,9 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
self.tic()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_closed(
self._test_ComputeNode_setAllocationScope_closed(
source_administration=person.getRelativeUrl())
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_ComputeNode_setAllocationScope_closed_termination_no_source_adm(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/termination",
......@@ -207,14 +182,10 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
self.tic()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_closed(
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/termination",
source_administration=person.getRelativeUrl())
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_ComputeNode_setAllocationScope_closed_outdated_no_source_adm(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/outdated",
......@@ -225,14 +196,10 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
self.tic()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_closed(
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/outdated",
source_administration=person.getRelativeUrl())
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_ComputeNode_setAllocationScope_closed_maintenance_no_source_adm(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/maintenance",
......@@ -243,15 +210,10 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
self.tic()
self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""])
compute_node = self._test_ComputeNode_setAllocationScope_closed(
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/maintenance",
source_administration=person.getRelativeUrl())
self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(compute_node.getDestinationSectionList(),
[person.getRelativeUrl()])
class TestSlapOSERP5InteractionWorkflowComputerNetworkSetReference(
SlapOSTestCaseMixin):
......
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