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