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
Ivan Tyagov
slapos.core
Commits
c0bcba1e
Commit
c0bcba1e
authored
Nov 09, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting&erp5: Test Person_[set|get]AggregatedDelivery
parent
1a2b1504
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
36 deletions
+50
-36
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+47
-10
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
...portal_components/test.erp5.testSlapOSAccountingSkins.xml
+3
-24
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+0
-2
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
c0bcba1e
# -*- coding: utf
-
8 -*-
# -*- coding: utf8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
withAbort
,
simulate
from
zExceptions
import
Unauthorized
...
...
@@ -29,7 +51,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
)
@
withAbort
def
test_
HS
_calculateSubscriptionStartDate_REQUEST_disallowed
(
self
):
def
test_
IT
_calculateSubscriptionStartDate_REQUEST_disallowed
(
self
):
item
=
self
.
createInstanceTree
()
self
.
assertRaises
(
Unauthorized
,
...
...
@@ -37,14 +59,14 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
REQUEST
=
{})
@
withAbort
def
test_
HS
_calculateSubscriptionStartDate_noWorkflow
(
self
):
def
test_
IT
_calculateSubscriptionStartDate_noWorkflow
(
self
):
item
=
self
.
createInstanceTree
()
item
.
workflow_history
[
'instance_slap_interface_workflow'
]
=
[]
date
=
item
.
InstanceTree_calculateSubscriptionStartDate
()
self
.
assertEqual
(
date
,
item
.
getCreationDate
().
earliestTime
())
@
withAbort
def
test_
HS
_calculateSubscriptionStartDate_withRequest
(
self
):
def
test_
IT
_calculateSubscriptionStartDate_withRequest
(
self
):
item
=
self
.
createInstanceTree
()
item
.
workflow_history
[
'instance_slap_interface_workflow'
]
=
[{
'comment'
:
'Directly request the instance'
,
...
...
@@ -58,7 +80,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
assertEqual
(
date
,
DateTime
(
'2012/11/15'
))
@
withAbort
def
test_
HS
_calculateSubscriptionStartDate_withRequestEndOfMonth
(
self
):
def
test_
IT
_calculateSubscriptionStartDate_withRequestEndOfMonth
(
self
):
item
=
self
.
createInstanceTree
()
item
.
workflow_history
[
'instance_slap_interface_workflow'
]
=
[{
'comment'
:
'Directly request the instance'
,
...
...
@@ -72,7 +94,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
assertEqual
(
date
,
DateTime
(
'2012/11/30'
))
@
withAbort
def
test_
HS
_calculateSubscriptionStartDate_withRequestAfterDestroy
(
self
):
def
test_
IT
_calculateSubscriptionStartDate_withRequestAfterDestroy
(
self
):
item
=
self
.
createInstanceTree
()
destroy_date
=
DateTime
(
'2012/10/30 11:11'
)
request_date
=
DateTime
(
'2012/11/30 11:11'
)
...
...
@@ -97,7 +119,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
assertEqual
(
date
,
DateTime
(
'2012/10/30'
))
@
withAbort
def
test_
HS
_calculateSubscriptionStopDate_REQUEST_disallowed
(
self
):
def
test_
IT
_calculateSubscriptionStopDate_REQUEST_disallowed
(
self
):
item
=
self
.
createInstanceTree
()
self
.
assertRaises
(
Unauthorized
,
...
...
@@ -105,7 +127,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
REQUEST
=
{})
@
withAbort
def
test_
HS
_calculateSubscriptionStopDate_withDestroy
(
self
):
def
test_
IT
_calculateSubscriptionStopDate_withDestroy
(
self
):
item
=
self
.
createInstanceTree
()
destroy_date
=
DateTime
(
'2012/10/30'
)
item
.
workflow_history
[
'instance_slap_interface_workflow'
].
append
({
...
...
@@ -120,7 +142,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
assertEqual
(
date
,
DateTime
(
'2012/10/31'
))
@
withAbort
def
test_
HS
_calculateSubscriptionStopDate_noDestroy
(
self
):
def
test_
IT
_calculateSubscriptionStopDate_noDestroy
(
self
):
item
=
self
.
createInstanceTree
()
item
.
workflow_history
[
'instance_slap_interface_workflow'
]
=
[]
date
=
item
.
InstanceTree_calculateSubscriptionStopDate
()
...
...
@@ -248,4 +270,19 @@ return context.getParentValue()""")
self
.
assertRaises
(
Unauthorized
,
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
,
REQUEST
=
{})
\ No newline at end of file
REQUEST
=
{})
def
test_Person_get_set_AggregatedDelivery
(
self
):
person
=
self
.
makePerson
()
self
.
assertEqual
(
person
.
Person_getAggregatedDelivery
(),
None
)
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
"Sale Packing List"
)
person
.
Person_setAggregatedDelivery
(
delivery
)
self
.
assertEqual
(
delivery
,
person
.
Person_getAggregatedDelivery
())
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
View file @
c0bcba1e
...
...
@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSAccountingSkins
</string>
</value>
...
...
@@ -55,28 +49,13 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -89,7 +68,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
c0bcba1e
...
...
@@ -174,8 +174,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_accounting/OrderBuilder_selectSlapOSAggregatedDeliveryList'
,
'slapos_accounting/PaymentTransaction_getExternalPaymentId'
,
'slapos_accounting/PaymentTransaction_postOrderBuild'
,
'slapos_accounting/Person_getAggregatedDelivery'
,
'slapos_accounting/Person_setAggregatedDelivery'
,
'slapos_accounting/SaleInvoiceTransaction_init'
,
'slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting'
,
'slapos_accounting/SaleInvoiceTransaction_isTotalPriceMatchingSalePackingList'
,
...
...
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