Commit 30b529c5 authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid super usage.

Yep, Luke is nice again for live test system.
parent 36f7389a
...@@ -81,9 +81,11 @@ if context.getTitle() == 'Not visited by %s': ...@@ -81,9 +81,11 @@ if context.getTitle() == 'Not visited by %s':
return wrapper return wrapper
class TestInstanceInvoicingAlarm(testSlapOSMixin): class TestInstanceInvoicingAlarm(testSlapOSMixin):
def afterSetUp(self): @withAbort
super(TestInstanceInvoicingAlarm, self).afterSetUp() def test_noSaleOrderPackingList_newSoftwareInstance(self):
"""
Be sure no delivery is created synchronously (break old code behaviour)
"""
self.software_instance_request_kw = dict( self.software_instance_request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(), software_release=self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(), software_type=self.generateNewSoftwareType(),
...@@ -91,22 +93,6 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -91,22 +93,6 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
sla_xml=self.generateSafeXml(), sla_xml=self.generateSafeXml(),
shared=False, shared=False,
) )
self.slave_instance_request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(),
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=True,
)
def beforeTearDown(self):
transaction.abort()
def test_noSaleOrderPackingList_newSoftwareInstance(self):
"""
Be sure no delivery is created synchronously (break old code behaviour)
"""
instance = self.portal.software_instance_module.template_software_instance\ instance = self.portal.software_instance_module.template_software_instance\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
instance.edit(title="TESTSI-%s" % self.generateNewId()) instance.edit(title="TESTSI-%s" % self.generateNewId())
...@@ -114,10 +100,19 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -114,10 +100,19 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.assertEqual(None, instance.getCausalityValue()) self.assertEqual(None, instance.getCausalityValue())
@withAbort
def test_noSaleOrderPackingList_newSlaveInstance(self): def test_noSaleOrderPackingList_newSlaveInstance(self):
""" """
Be sure no delivery is created synchronously (break old code behaviour) Be sure no delivery is created synchronously (break old code behaviour)
""" """
self.slave_instance_request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(),
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=True,
)
instance = self.portal.software_instance_module.template_slave_instance\ instance = self.portal.software_instance_module.template_slave_instance\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
instance.edit(title="TESTSI-%s" % self.generateNewId()) instance.edit(title="TESTSI-%s" % self.generateNewId())
...@@ -168,6 +163,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -168,6 +163,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
'Visited by Instance_solveInvoicingGeneration', 'Visited by Instance_solveInvoicingGeneration',
instance.workflow_history['edit_workflow'][-1]['comment']) instance.workflow_history['edit_workflow'][-1]['comment'])
@withAbort
def test_solved_instance(self): def test_solved_instance(self):
instance = self.portal.software_instance_module\ instance = self.portal.software_instance_module\
.template_slave_instance.Base_createCloneDocument(batch_mode=1) .template_slave_instance.Base_createCloneDocument(batch_mode=1)
...@@ -193,6 +189,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -193,6 +189,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.assertEqual(instance.getCausalityState(), 'solved') self.assertEqual(instance.getCausalityState(), 'solved')
self.assertEqual(None, instance.getCausalityValue()) self.assertEqual(None, instance.getCausalityValue())
@withAbort
def test_instance_in_draft_state(self): def test_instance_in_draft_state(self):
instance = self.portal.software_instance_module\ instance = self.portal.software_instance_module\
.template_slave_instance.Base_createCloneDocument(batch_mode=1) .template_slave_instance.Base_createCloneDocument(batch_mode=1)
...@@ -216,6 +213,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -216,6 +213,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.assertEqual(instance.getCausalityState(), 'solved') self.assertEqual(instance.getCausalityState(), 'solved')
self.assertEqual(None, instance.getCausalityValue()) self.assertEqual(None, instance.getCausalityValue())
@withAbort
def test_instance_in_unknown_state(self): def test_instance_in_unknown_state(self):
instance = self.portal.software_instance_module\ instance = self.portal.software_instance_module\
.template_slave_instance.Base_createCloneDocument(batch_mode=1) .template_slave_instance.Base_createCloneDocument(batch_mode=1)
...@@ -237,6 +235,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -237,6 +235,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.assertRaises(AssertionError, instance.Instance_solveInvoicingGeneration) self.assertRaises(AssertionError, instance.Instance_solveInvoicingGeneration)
@withAbort
def test_instance_in_early_destroyed_state(self): def test_instance_in_early_destroyed_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -308,6 +307,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -308,6 +307,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
[instance, subscription]) [instance, subscription])
self.assertEqual(len(movement.contentValues()), 0) self.assertEqual(len(movement.contentValues()), 0)
@withAbort
def test_instance_create_non_destroyed_state(self): def test_instance_create_non_destroyed_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -348,6 +348,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -348,6 +348,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.check_instance_delivery(delivery, start_date, stop_date, person, 1) self.check_instance_delivery(delivery, start_date, stop_date, person, 1)
self.check_instance_movement(setup_line, instance, subscription, 1) self.check_instance_movement(setup_line, instance, subscription, 1)
@withAbort
def test_instance_create_non_destroyed_with_update_state(self): def test_instance_create_non_destroyed_with_update_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -405,6 +406,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -405,6 +406,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.check_instance_movement(setup_line, instance, subscription, 1) self.check_instance_movement(setup_line, instance, subscription, 1)
self.check_instance_movement(update_line, instance, subscription, 2) self.check_instance_movement(update_line, instance, subscription, 2)
@withAbort
def test_instance_create_destroyed_with_update_state(self): def test_instance_create_destroyed_with_update_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -463,6 +465,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -463,6 +465,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.check_instance_movement(update_line, instance, subscription, 1) self.check_instance_movement(update_line, instance, subscription, 1)
self.check_instance_movement(destroy_line, instance, subscription, 1) self.check_instance_movement(destroy_line, instance, subscription, 1)
@withAbort
def test_instance_update_non_destroyed_state(self): def test_instance_update_non_destroyed_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -522,6 +525,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -522,6 +525,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.check_instance_delivery(delivery, start_date, stop_date, person, 1) self.check_instance_delivery(delivery, start_date, stop_date, person, 1)
self.check_instance_movement(update_line, instance, subscription, 2) self.check_instance_movement(update_line, instance, subscription, 2)
@withAbort
def test_instance_update_destroyed_state(self): def test_instance_update_destroyed_state(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
...@@ -582,6 +586,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin): ...@@ -582,6 +586,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self.check_instance_movement(update_line, instance, subscription, 1) self.check_instance_movement(update_line, instance, subscription, 1)
self.check_instance_movement(destroy_line, instance, subscription, 1) self.check_instance_movement(destroy_line, instance, subscription, 1)
@withAbort
def test_instance_update_already_destroyed(self): def test_instance_update_already_destroyed(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
......
172 173
\ No newline at end of file \ No newline at end of file
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