Commit 7a26464d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_*: (Test) Unhardcode organisation_module/slapos from the tests

parent 2a79ed11
...@@ -1106,11 +1106,11 @@ class TestSlapOSStartConfirmedAggregatedSalePackingListAlarm( ...@@ -1106,11 +1106,11 @@ class TestSlapOSStartConfirmedAggregatedSalePackingListAlarm(
portal_type="Sale Packing List", portal_type="Sale Packing List",
start_date=DateTime("2012/04/22"), start_date=DateTime("2012/04/22"),
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
destination='organisation_module/slapos', destination=self.expected_slapos_organisation,
destination_section='organisation_module/slapos', destination_section=self.expected_slapos_organisation,
destination_decision='organisation_module/slapos', destination_decision=self.expected_slapos_organisation,
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
) )
delivery.newContent( delivery.newContent(
......
...@@ -55,8 +55,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin): ...@@ -55,8 +55,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
self.assertEqual(simulation_movement.getStopDate(), self.assertEqual(simulation_movement.getStopDate(),
delivery.getStopDate()) delivery.getStopDate())
self.assertSameSet([ self.assertSameSet([
'source/organisation_module/slapos', 'source/%s' % self.expected_slapos_organisation,
'source_section/organisation_module/slapos', 'source_section/%s' % self.expected_slapos_organisation,
'price_currency/currency_module/EUR', 'price_currency/currency_module/EUR',
'specialise/sale_trade_condition_module/slapos_aggregated_trade_condition'] \ 'specialise/sale_trade_condition_module/slapos_aggregated_trade_condition'] \
+ convertCategoryList('destination', + convertCategoryList('destination',
...@@ -92,8 +92,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin): ...@@ -92,8 +92,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='service_module/slapos_instance_subscription', resource='service_module/slapos_instance_subscription',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/delivery', trade_phase='slapos/delivery',
use='trade/sale', use='trade/sale',
...@@ -151,8 +151,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder): ...@@ -151,8 +151,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
delivery_kw = dict( delivery_kw = dict(
portal_type='Sale Packing List', portal_type='Sale Packing List',
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
) )
delivery_line_kw = dict( delivery_line_kw = dict(
...@@ -222,8 +222,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder): ...@@ -222,8 +222,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='service_module/slapos_instance_subscription', resource='service_module/slapos_instance_subscription',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/delivery', trade_phase='slapos/delivery',
use='trade/sale', use='trade/sale',
...@@ -423,8 +423,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -423,8 +423,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
# linked invoice # linked invoice
invoice_kw = dict( invoice_kw = dict(
portal_type='Sale Invoice Transaction', portal_type='Sale Invoice Transaction',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
resource='currency_module/EUR', resource='currency_module/EUR',
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
...@@ -504,8 +504,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -504,8 +504,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='service_module/slapos_instance_subscription', resource='service_module/slapos_instance_subscription',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
use='trade/sale', use='trade/sale',
) )
...@@ -595,7 +595,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -595,7 +595,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -615,7 +615,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -615,7 +615,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -636,7 +636,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -636,7 +636,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -655,7 +655,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -655,7 +655,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/coll_vat', source='account_module/coll_vat',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -677,7 +677,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -677,7 +677,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -694,7 +694,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -694,7 +694,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -715,7 +715,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -715,7 +715,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/receivable', source='account_module/receivable',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -731,7 +731,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder): ...@@ -731,7 +731,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='currency_module/EUR', resource='currency_module/EUR',
source='account_module/coll_vat', source='account_module/coll_vat',
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
trade_phase='slapos/accounting', trade_phase='slapos/accounting',
price=1.0, price=1.0,
...@@ -926,8 +926,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis ...@@ -926,8 +926,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
# linked invoice # linked invoice
invoice_kw = dict( invoice_kw = dict(
portal_type='Sale Invoice Transaction', portal_type='Sale Invoice Transaction',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
resource='currency_module/EUR', resource='currency_module/EUR',
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
...@@ -991,8 +991,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis ...@@ -991,8 +991,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
quantity_unit='unit/piece', quantity_unit='unit/piece',
resource='service_module/slapos_instance_subscription', resource='service_module/slapos_instance_subscription',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
use='trade/sale', use='trade/sale',
) )
...@@ -1031,8 +1031,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis ...@@ -1031,8 +1031,8 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
base_application='base_amount/invoicing/taxable', base_application='base_amount/invoicing/taxable',
price_currency='currency_module/EUR', price_currency='currency_module/EUR',
quantity_unit='unit/piece', quantity_unit='unit/piece',
source='organisation_module/slapos', source=self.expected_slapos_organisation,
source_section='organisation_module/slapos', source_section=self.expected_slapos_organisation,
specialise='sale_trade_condition_module/slapos_aggregated_trade_condition', specialise='sale_trade_condition_module/slapos_aggregated_trade_condition',
portal_type='Simulation Movement', portal_type='Simulation Movement',
) )
...@@ -1262,8 +1262,8 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin): ...@@ -1262,8 +1262,8 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin):
'destination_decision/%s' % person.getRelativeUrl(), 'destination_decision/%s' % person.getRelativeUrl(),
'destination_section/%s' % person.getRelativeUrl(), 'destination_section/%s' % person.getRelativeUrl(),
'price_currency/currency_module/EUR', 'price_currency/currency_module/EUR',
'source/organisation_module/slapos', 'source/%s' % self.expected_slapos_organisation,
'source_section/organisation_module/slapos', 'source_section/%s' % self.expected_slapos_organisation,
'specialise/sale_trade_condition_module/' 'specialise/sale_trade_condition_module/'
'slapos_aggregated_trade_condition'], 'slapos_aggregated_trade_condition'],
built_delivery.getCategoryList()) built_delivery.getCategoryList())
......
...@@ -80,6 +80,8 @@ def withAbort(func): ...@@ -80,6 +80,8 @@ def withAbort(func):
class SlapOSTestCaseMixin(testSlapOSMixin): class SlapOSTestCaseMixin(testSlapOSMixin):
expected_html_payzen_redirect_page = None
# Define few expected defaults # Define few expected defaults
expected_invoice_en_notification_message = 'A new invoice has been generated' expected_invoice_en_notification_message = 'A new invoice has been generated'
...@@ -90,6 +92,9 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -90,6 +92,9 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
_custom_expected_module_list = [] _custom_expected_module_list = []
_custom_additional_bt5_list = [] _custom_additional_bt5_list = []
# Expected organisation when generate invoices, tickets, etc...
expected_slapos_organisation = "organisation_module/slapos"
def afterSetUp(self): def afterSetUp(self):
testSlapOSMixin.afterSetUp(self) testSlapOSMixin.afterSetUp(self)
self.changeSkin('View') self.changeSkin('View')
...@@ -97,7 +102,9 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -97,7 +102,9 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
self.new_id = self.generateNewId() self.new_id = self.generateNewId()
# Define default Organisation # Define default Organisation
self.slapos_organisation = self.portal.organisation_module.slapos self.slapos_organisation = self.portal.restrictedTraverse(
self.expected_slapos_organisation
)
instance_template = self.portal.software_instance_module.template_software_instance instance_template = self.portal.software_instance_module.template_software_instance
if len(instance_template.objectValues()): if len(instance_template.objectValues()):
......
...@@ -280,7 +280,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -280,7 +280,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
ticket = self.createRegularisationRequest() ticket = self.createRegularisationRequest()
ticket.edit( ticket.edit(
source='organisation_module/slapos', source=self.expected_slapos_organisation,
destination_value=person, destination_value=person,
source_project_value=person) source_project_value=person)
ticket.validate() ticket.validate()
...@@ -300,7 +300,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -300,7 +300,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
self.assertEqual(event.getTitle(), "foo title") self.assertEqual(event.getTitle(), "foo title")
self.assertEqual(event.getResource(), 'service_module/slapos_crm_spam') self.assertEqual(event.getResource(), 'service_module/slapos_crm_spam')
self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl()) self.assertEqual(event.getFollowUp(), ticket.getRelativeUrl())
self.assertEqual(event.getSource(), "organisation_module/slapos") self.assertEqual(event.getSource(), self.expected_slapos_organisation)
self.assertEqual(event.getDestination(), person.getRelativeUrl()) self.assertEqual(event.getDestination(), person.getRelativeUrl())
self.assertEqual(event.getTextContent(), 'foo content') self.assertEqual(event.getTextContent(), 'foo content')
...@@ -316,7 +316,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -316,7 +316,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
ticket = self.createRegularisationRequest() ticket = self.createRegularisationRequest()
ticket.edit( ticket.edit(
source='organisation_module/slapos', source=self.expected_slapos_organisation,
destination_value=person, destination_value=person,
source_project_value=person) source_project_value=person)
ticket.validate() ticket.validate()
...@@ -335,7 +335,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -335,7 +335,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
ticket = self.createRegularisationRequest() ticket = self.createRegularisationRequest()
ticket.edit( ticket.edit(
source='organisation_module/slapos', source=self.expected_slapos_organisation,
destination_value=person, destination_value=person,
source_project_value=person) source_project_value=person)
ticket.validate() ticket.validate()
...@@ -360,7 +360,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -360,7 +360,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
ticket = self.createRegularisationRequest() ticket = self.createRegularisationRequest()
ticket.edit( ticket.edit(
source='organisation_module/slapos', source=self.expected_slapos_organisation,
destination_value=person, destination_value=person,
source_project_value=person) source_project_value=person)
ticket.validate() ticket.validate()
...@@ -373,7 +373,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -373,7 +373,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
ticket = self.createRegularisationRequest() ticket = self.createRegularisationRequest()
ticket.edit( ticket.edit(
source='organisation_module/slapos', source=self.expected_slapos_organisation,
destination_value=person, destination_value=person,
source_project_value=person) source_project_value=person)
ticket.validate() ticket.validate()
......
...@@ -37,8 +37,8 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -37,8 +37,8 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.expected_reservation_tax = 4.166666666666667 self.expected_reservation_tax = 4.166666666666667
self.expected_price_currency = "currency_module/EUR" self.expected_price_currency = "currency_module/EUR"
self.expected_notification_language = "en" self.expected_notification_language = "en"
self.expected_source = "organisation_module/slapos" self.expected_source = self.expected_slapos_organisation
self.expected_source_section = "organisation_module/slapos" self.expected_source_section = self.expected_slapos_organisation
self.cloud_invitation_token = None self.cloud_invitation_token = None
self.expected_free_reservation = 0 self.expected_free_reservation = 0
self.skip_destroy_and_check = 0 self.skip_destroy_and_check = 0
......
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