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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
8db73384
Commit
8db73384
authored
Mar 03, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: test: drop unused functions
parent
15ca95d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
163 deletions
+0
-163
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+0
-163
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
8db73384
...
...
@@ -214,42 +214,6 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
project
.
validate
()
return
project
def
makeCustomOrganisation
(
self
,
new_id
=
None
,
index
=
True
,
price_currency
=
"currency_module/EUR"
):
# Create a custom organisation same as slapos, for ensure we can have
# multiple organisations working on the site
if
new_id
is
None
:
new_id
=
self
.
generateNewId
()
custom_organisation
=
self
.
portal
.
organisation_module
.
slapos
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
custom_organisation
.
edit
(
title
=
"organisation_live_test_%s"
%
new_id
,
reference
=
"organisation_live_test_%s"
%
new_id
,
default_email_text
=
"organisation_live_test_%s@example.org"
%
new_id
,
)
custom_organisation
.
validate
()
self
.
assertEqual
(
custom_organisation
.
getGroup
(),
"company"
)
self
.
assertEqual
(
"currency_module/EUR"
,
custom_organisation
.
getPriceCurrency
())
custom_organisation
.
setPriceCurrency
(
price_currency
)
self
.
assertNotEqual
(
getattr
(
custom_organisation
,
"bank_account"
,
None
),
None
)
if
index
:
custom_organisation
.
updateLocalRolesOnSecurityGroups
()
custom_organisation
.
bank_account
.
updateLocalRolesOnSecurityGroups
()
transaction
.
commit
()
custom_organisation
.
immediateReindexObject
()
return
custom_organisation
def
_addERP5Login
(
self
,
document
,
**
kw
):
if
document
.
getPortalType
()
==
"Person"
:
kw
[
"password"
]
=
document
.
Person_generatePassword
()
...
...
@@ -938,133 +902,6 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
'Visited by %s'
%
script_name
,
content
)
def
restoreAccountingTemplatesOnPreferences
(
self
):
self
.
login
()
system_preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
system_preference
.
edit
(
preferred_aggregated_consumption_sale_trade_condition
=
\
'sale_trade_condition_module/slapos_aggregated_consumption_trade_condition'
,
preferred_aggregated_sale_trade_condition
=
\
'sale_trade_condition_module/slapos_aggregated_trade_condition_v3'
,
preferred_aggregated_subscription_sale_trade_condition
=
\
'sale_trade_condition_module/slapos_aggregated_subscription_trade_condition_v3'
,
preferred_default_pre_payment_template
=
\
'accounting_module/slapos_pre_payment_template'
,
preferred_instance_delivery_template
=
\
'sale_packing_list_module/slapos_accounting_instance_delivery_template'
,
preferred_default_pre_payment_subscription_invoice_template
=
\
'accounting_module/template_pre_payment_subscription_sale_invoice_transaction'
)
self
.
portal
.
sale_trade_condition_module
.
default_subscription_trade_condition
.
edit
(
source_section
=
'organisation_module/slapos'
,
source
=
'organisation_module/slapos'
)
self
.
tic
()
def
redefineAccountingTemplatesonPreferences
(
self
,
price_currency
=
"currency_module/EUR"
):
# Define a new set of templates and change organisation on them, in this way tests should
# behave the same.
self
.
login
()
organisation
=
self
.
makeCustomOrganisation
(
price_currency
=
price_currency
)
accounting_module
=
self
.
portal
.
accounting_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
preferred_default_pre_payment_template
=
\
accounting_module
.
slapos_pre_payment_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_template
.
edit
(
source_section_value
=
organisation
,
source_payment_value
=
organisation
.
bank_account
)
preferred_default_pre_payment_subscription_invoice_template
=
\
accounting_module
.
template_pre_payment_subscription_sale_invoice_transaction
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_subscription_invoice_template
.
edit
(
source_section_value
=
organisation
,
source_value
=
organisation
)
preferred_instance_delivery_template
=
\
sale_packing_list_module
.
slapos_accounting_instance_delivery_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_instance_delivery_template
.
edit
(
source_section_value
=
organisation
,
source_value
=
organisation
)
self
.
portal
.
sale_trade_condition_module
.
default_subscription_trade_condition
.
edit
(
source_section_value
=
organisation
,
source_value
=
organisation
)
system_preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
system_preference
.
edit
(
preferred_default_pre_payment_template
=
preferred_default_pre_payment_template
.
getRelativeUrl
(),
preferred_default_pre_payment_subscription_invoice_template
=
\
preferred_default_pre_payment_subscription_invoice_template
.
getRelativeUrl
(),
preferred_instance_delivery_template
=
\
preferred_instance_delivery_template
.
getRelativeUrl
()
)
self
.
tic
()
return
organisation
def
redefineAccountingTemplatesonPreferencesWithDualOrganisation
(
self
):
# Define a new set of templates and change organisation on them, in this way tests should
# behave the same.
self
.
login
()
fr_organisation
=
self
.
makeCustomOrganisation
()
zh_organisation
=
self
.
makeCustomOrganisation
(
price_currency
=
"currency_module/CNY"
)
# Update Price currency for Chinese company
accounting_module
=
self
.
portal
.
accounting_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
preferred_default_pre_payment_template
=
\
accounting_module
.
slapos_pre_payment_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_template
.
edit
(
source_section_value
=
fr_organisation
,
source_payment_value
=
fr_organisation
.
bank_account
)
preferred_default_pre_payment_subscription_invoice_template
=
\
accounting_module
.
template_pre_payment_subscription_sale_invoice_transaction
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_subscription_invoice_template
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
preferred_instance_delivery_template
=
\
sale_packing_list_module
.
slapos_accounting_instance_delivery_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_instance_delivery_template
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
self
.
portal
.
sale_trade_condition_module
.
default_subscription_trade_condition
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
system_preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
system_preference
.
edit
(
preferred_default_pre_payment_template
=
preferred_default_pre_payment_template
.
getRelativeUrl
(),
preferred_default_pre_payment_subscription_invoice_template
=
\
preferred_default_pre_payment_subscription_invoice_template
.
getRelativeUrl
(),
preferred_instance_delivery_template
=
\
preferred_instance_delivery_template
.
getRelativeUrl
()
)
self
.
tic
()
return
fr_organisation
,
zh_organisation
class
SlapOSTestCaseMixinWithAbort
(
SlapOSTestCaseMixin
):
abort_transaction
=
1
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