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
Hardik Juneja
slapos.core
Commits
349c263d
Commit
349c263d
authored
Sep 26, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Fix simultate method 'updateSimulation' and rewrite consistency messages
parent
b76cd527
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
54 deletions
+83
-54
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
.../portal_components/test.erp5.testSlapOSAccountingAlarm.py
+14
-8
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.xml
...portal_components/test.erp5.testSlapOSAccountingAlarm.xml
+18
-18
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingConstraint.py
...al_components/test.erp5.testSlapOSAccountingConstraint.py
+20
-20
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingConstraint.xml
...l_components/test.erp5.testSlapOSAccountingConstraint.xml
+31
-8
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
View file @
349c263d
...
...
@@ -479,6 +479,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
destination_section_value
=
person
)
instance
=
self
.
portal
.
software_instance_module
\
.
template_slave_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
previous_delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
new_id
=
self
.
generateNewId
()
...
...
@@ -1329,6 +1330,9 @@ class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
@
withAbort
def
test_SimulationMovement_buildSlapOS
(
self
):
build_simulator
=
tempfile
.
mkstemp
()[
1
]
activate_simulator
=
tempfile
.
mkstemp
()[
1
]
business_process
=
self
.
portal
.
business_process_module
.
newContent
(
portal_type
=
'Business Process'
)
root_business_link
=
business_process
.
newContent
(
...
...
@@ -1346,8 +1350,6 @@ class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
causality
=
business_link
.
getRelativeUrl
(),
portal_type
=
'Simulation Movement'
)
build_simulator
=
tempfile
.
mkstemp
()[
1
]
activate_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
from
Products.CMFActivity.ActiveObject
import
ActiveObject
ActiveObject
.
original_activate
=
ActiveObject
.
activate
...
...
@@ -1411,6 +1413,9 @@ class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
@
withAbort
def
test_SimulationMovement_buildSlapOS_withDelivery
(
self
):
build_simulator
=
tempfile
.
mkstemp
()[
1
]
activate_simulator
=
tempfile
.
mkstemp
()[
1
]
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
delivery_line
=
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
)
...
...
@@ -1433,8 +1438,6 @@ class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
delivery
=
delivery_line
.
getRelativeUrl
(),
portal_type
=
'Simulation Movement'
)
build_simulator
=
tempfile
.
mkstemp
()[
1
]
activate_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
from
Products.CMFActivity.ActiveObject
import
ActiveObject
ActiveObject
.
original_activate
=
ActiveObject
.
activate
...
...
@@ -1501,17 +1504,18 @@ class TestSlapOSManageBuildingCalculatingDeliveryAlarm(testSlapOSMixin):
@
withAbort
def
_test_Delivery_manageBuildingCalculatingDelivery
(
self
,
state
,
empty
=
False
):
updateCausalityState_simulator
=
tempfile
.
mkstemp
()[
1
]
updateSimulation_simulator
=
tempfile
.
mkstemp
()[
1
]
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
title
=
'Not visited by Delivery_manageBuildingCalculatingDelivery'
,
portal_type
=
'Sale Packing List'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
delivery
,
state
)
updateCausalityState_simulator
=
tempfile
.
mkstemp
()[
1
]
updateSimulation_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
from
Products.ERP5.Document.Delivery
import
Delivery
Delivery
.
original_updateCausalityState
=
Delivery
\
.
updateCausalityState
Delivery
.
original_updateCausalityState
=
Delivery
.
updateCausalityState
Delivery
.
original_updateSimulation
=
Delivery
.
updateSimulation
Delivery
.
updateCausalityState
=
Simulator
(
updateCausalityState_simulator
,
'updateCausalityState'
)
Delivery
.
updateSimulation
=
Simulator
(
...
...
@@ -1540,7 +1544,9 @@ class TestSlapOSManageBuildingCalculatingDeliveryAlarm(testSlapOSMixin):
)
finally
:
Delivery
.
updateCausalityState
=
Delivery
.
original_updateCausalityState
Delivery
.
updateSimulation
=
Delivery
.
original_updateSimulation
delattr
(
Delivery
,
'original_updateCausalityState'
)
delattr
(
Delivery
,
'original_updateSimulation'
)
if
os
.
path
.
exists
(
updateCausalityState_simulator
):
os
.
unlink
(
updateCausalityState_simulator
)
if
os
.
path
.
exists
(
updateSimulation_simulator
):
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.xml
View file @
349c263d
...
...
@@ -51,24 +51,24 @@
<string>
W:350, 16: Unused variable \'update_line\' (unused-variable)
</string>
<string>
W:350, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:407, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:52
7
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:52
7
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:58
7
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:64
8
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:64
8
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:68
7
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:68
7
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:136
2
, 20: Use of eval (eval-used)
</string>
<string>
W:136
3
, 23: Use of eval (eval-used)
</string>
<string>
W:138
4
, 20: Use of eval (eval-used)
</string>
<string>
W:138
5
, 23: Use of eval (eval-used)
</string>
<string>
W:14
49
, 20: Use of eval (eval-used)
</string>
<string>
W:145
0
, 23: Use of eval (eval-used)
</string>
<string>
W:14
59
, 20: Use of eval (eval-used)
</string>
<string>
W:146
0
, 23: Use of eval (eval-used)
</string>
<string>
W:152
2
, 35: Use of eval (eval-used)
</string>
<string>
W:152
3
, 31: Use of eval (eval-used)
</string>
<string>
W:16
89
, 4: Unused variable \'movement\' (unused-variable)
</string>
<string>
W:52
8
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:52
8
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:58
8
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:64
9
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:64
9
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:68
8
, 29: Unused variable \'destroy_line\' (unused-variable)
</string>
<string>
W:68
8
, 4: Unused variable \'setup_line\' (unused-variable)
</string>
<string>
W:136
4
, 20: Use of eval (eval-used)
</string>
<string>
W:136
5
, 23: Use of eval (eval-used)
</string>
<string>
W:138
6
, 20: Use of eval (eval-used)
</string>
<string>
W:138
7
, 23: Use of eval (eval-used)
</string>
<string>
W:14
52
, 20: Use of eval (eval-used)
</string>
<string>
W:145
3
, 23: Use of eval (eval-used)
</string>
<string>
W:14
62
, 20: Use of eval (eval-used)
</string>
<string>
W:146
3
, 23: Use of eval (eval-used)
</string>
<string>
W:152
6
, 35: Use of eval (eval-used)
</string>
<string>
W:152
7
, 31: Use of eval (eval-used)
</string>
<string>
W:16
95
, 4: Unused variable \'movement\' (unused-variable)
</string>
</tuple>
</value>
</item>
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingConstraint.py
View file @
349c263d
...
...
@@ -20,12 +20,12 @@ class TestHostingSubscription(TestSlapOSConstraintMixin):
portal_type
=
'Hosting Subscription'
)
def
afterSetUp
(
self
):
super
(
TestHostingSubscription
,
self
).
afterSetUp
(
)
TestSlapOSConstraintMixin
.
afterSetUp
(
self
)
self
.
_createHostingSubscription
()
def
beforeTearDown
(
self
):
transaction
.
abort
()
super
(
TestHostingSubscription
,
self
).
beforeTearDown
(
)
TestSlapOSConstraintMixin
.
beforeTearDown
(
self
)
def
test_periodicity_hour_list_value
(
self
):
value
=
7
...
...
@@ -115,15 +115,15 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
def
test_price_currency
(
self
):
invoice
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Sale Invoice Transaction'
)
message
=
"Arity Error for Relation ['price_currency']
, arity is equal
"
\
"to 0 but should be between 1 and 1"
message
=
"Arity Error for Relation ['price_currency']
and Type
"
\
"
('Currency',), arity is equal
to 0 but should be between 1 and 1"
self
.
_test_currency
(
invoice
,
invoice
.
setPriceCurrency
,
message
)
def
test_resource
(
self
):
invoice
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Sale Invoice Transaction'
)
message
=
"Arity Error for Relation ['resource']
, arity is equal
"
\
"to 0 but should be between 1 and 1"
message
=
"Arity Error for Relation ['resource']
and Type
"
\
"
('Currency',), arity is equal
to 0 but should be between 1 and 1"
self
.
_test_currency
(
invoice
,
invoice
.
setResource
,
message
)
@
withAbort
...
...
@@ -131,8 +131,8 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
invoice
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Sale Invoice Transaction'
)
setter
=
invoice
.
setSpecialise
message
=
"Arity Error for Relation ['specialise']
, arity is equal
"
\
"to 0 but should be at least 1"
message
=
"Arity Error for Relation ['specialise']
and Type
"
\
"
('Sale Trade Condition',), arity is equal
to 0 but should be at least 1"
self
.
assertTrue
(
message
in
self
.
getMessageList
(
invoice
))
sale_condition
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
...
...
@@ -264,10 +264,10 @@ class TestSalePackingList(TestSlapOSConstraintMixin):
@
withAbort
def
_test_category_arrow
(
self
,
category
):
message
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"2 but should be between 1 and 1"
%
category
message
=
"Arity Error for Relation ['%s']
and Type ('Organisation',
"
\
"
'Person'), arity is equal to
0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
and Type ('Organisation',
"
\
"
'Person'), arity is equal to
2 but should be between 1 and 1"
%
category
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
resource
=
self
.
portal
.
service_module
.
newContent
(
...
...
@@ -308,10 +308,10 @@ class TestSalePackingList(TestSlapOSConstraintMixin):
@
withAbort
def
test_specialise
(
self
):
category
=
'specialise'
message
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"2 but should be between 1 and 1"
%
category
message
=
"Arity Error for Relation ['%s']
and Type ('Sale Trade Condition
"
\
"
',), arity is equal to
0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
and Type ('Sale Trade Condition
"
\
"
',), arity is equal to
2 but should be between 1 and 1"
%
category
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
resource
=
self
.
portal
.
service_module
.
newContent
(
...
...
@@ -362,10 +362,10 @@ class TestSalePackingListLine(TestSlapOSConstraintMixin):
@
withAbort
def
test_resource_arity
(
self
):
category
=
'resource'
message
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
, arity is equal to
"
\
"2 but should be between 1 and 1"
%
category
message
=
"Arity Error for Relation ['%s']
and Type ('Service',), arity is
"
\
"
equal to
0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s']
and Type ('Service',), arity is
"
\
"
equal to
2 but should be between 1 and 1"
%
category
delivery_line
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
).
newContent
(
portal_type
=
'Sale Packing List Line'
)
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingConstraint.xml
View file @
349c263d
...
...
@@ -6,10 +6,22 @@
</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>
testSlapOSAccountingConstraint
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSAccountingConstraint
</string>
</value>
...
...
@@ -27,11 +39,7 @@
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple>
<string>
F: 7, 0: Unable to import \'testSlapOSCloudConstraint\' (import-error)
</string>
<string>
E: 22, 2: Use of super on an old style class (super-on-old-class)
</string>
<string>
E: 26, 2: Use of super on an old style class (super-on-old-class)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -47,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</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>
...
...
@@ -66,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -75,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
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