Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnaud Véron
slapos.core
Commits
7a26464d
Commit
7a26464d
authored
Dec 08, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_*: (Test) Unhardcode organisation_module/slapos from the tests
parent
2a79ed11
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
42 deletions
+49
-42
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
.../portal_components/test.erp5.testSlapOSAccountingAlarm.py
+5
-5
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
...ortal_components/test.erp5.testSlapOSAccountingBuilder.py
+28
-28
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+8
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
...ents/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
+6
-6
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+2
-2
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
View file @
7a26464d
...
...
@@ -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
(
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
View file @
7a26464d
...
...
@@ -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
())
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
7a26464d
...
...
@@ -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
()):
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
View file @
7a26464d
...
...
@@ -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
()
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
7a26464d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment