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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
9523a793
Commit
9523a793
authored
Oct 05, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Minor clean up on test for allow us overwrite methods more easily
parent
fef02529
Pipeline
#17731
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+7
-5
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionNewTemplateChineseScenario.py
....erp5.testSlapOSSubscriptionNewTemplateChineseScenario.py
+2
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
9523a793
...
@@ -117,7 +117,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
...
@@ -117,7 +117,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
"""Overwrite this function on project context to tweak production focus tests"""
"""Overwrite this function on project context to tweak production focus tests"""
pass
pass
def
makeCustomOrganisation
(
self
,
new_id
=
None
,
index
=
True
):
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
# Create a custom organisation same as slapos, for ensure we can have
# multiple organisations working on the site
# multiple organisations working on the site
...
@@ -140,6 +141,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
...
@@ -140,6 +141,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
self
.
assertEqual
(
"currency_module/EUR"
,
self
.
assertEqual
(
"currency_module/EUR"
,
custom_organisation
.
getPriceCurrency
())
custom_organisation
.
getPriceCurrency
())
custom_organisation
.
setPriceCurrency
(
price_currency
)
self
.
assertNotEqual
(
getattr
(
custom_organisation
,
"bank_account"
,
None
),
None
)
self
.
assertNotEqual
(
getattr
(
custom_organisation
,
"bank_account"
,
None
),
None
)
if
index
:
if
index
:
...
@@ -709,11 +711,11 @@ return %s""" % (script_name, fake_return ))
...
@@ -709,11 +711,11 @@ return %s""" % (script_name, fake_return ))
)
)
self
.
tic
()
self
.
tic
()
def
redefineAccountingTemplatesonPreferences
(
self
):
def
redefineAccountingTemplatesonPreferences
(
self
,
price_currency
=
"currency_module/EUR"
):
# Define a new set of templates and change organisation on them, in this way tests should
# Define a new set of templates and change organisation on them, in this way tests should
# behave the same.
# behave the same.
self
.
login
()
self
.
login
()
organisation
=
self
.
makeCustomOrganisation
()
organisation
=
self
.
makeCustomOrganisation
(
price_currency
=
price_currency
)
accounting_module
=
self
.
portal
.
accounting_module
accounting_module
=
self
.
portal
.
accounting_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
...
@@ -787,10 +789,10 @@ return %s""" % (script_name, fake_return ))
...
@@ -787,10 +789,10 @@ return %s""" % (script_name, fake_return ))
# behave the same.
# behave the same.
self
.
login
()
self
.
login
()
fr_organisation
=
self
.
makeCustomOrganisation
()
fr_organisation
=
self
.
makeCustomOrganisation
()
zh_organisation
=
self
.
makeCustomOrganisation
()
zh_organisation
=
self
.
makeCustomOrganisation
(
price_currency
=
"currency_module/CNY"
)
# Update Price currency for Chinese company
# Update Price currency for Chinese company
zh_organisation
.
setPriceCurrency
(
"currency_module/CNY"
)
accounting_module
=
self
.
portal
.
accounting_module
accounting_module
=
self
.
portal
.
accounting_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionNewTemplateChineseScenario.py
View file @
9523a793
...
@@ -25,7 +25,8 @@ class testSlapOSSubscriptionNewTemplateChineseScenario(TestSlapOSSubscriptionChi
...
@@ -25,7 +25,8 @@ class testSlapOSSubscriptionNewTemplateChineseScenario(TestSlapOSSubscriptionChi
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
TestSlapOSSubscriptionChineseScenarioMixin
.
afterSetUp
(
self
)
TestSlapOSSubscriptionChineseScenarioMixin
.
afterSetUp
(
self
)
organisation
=
self
.
redefineAccountingTemplatesonPreferences
()
organisation
=
self
.
redefineAccountingTemplatesonPreferences
(
price_currency
=
"currency_module/CNY"
)
self
.
expected_source
=
organisation
.
getRelativeUrl
()
self
.
expected_source
=
organisation
.
getRelativeUrl
()
self
.
expected_source_section
=
organisation
.
getRelativeUrl
()
self
.
expected_source_section
=
organisation
.
getRelativeUrl
()
...
...
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