Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
b55cc850
Commit
b55cc850
authored
Feb 27, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSL needs to be sorted on destination category & resource otherwise result can be random
parent
12eaa883
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
product/ERP5/tests/testResource.py
product/ERP5/tests/testResource.py
+23
-2
No files found.
product/ERP5/tests/testResource.py
View file @
b55cc850
...
@@ -874,7 +874,28 @@ class TestResource(ERP5TypeTestCase):
...
@@ -874,7 +874,28 @@ class TestResource(ERP5TypeTestCase):
tab
=
1
)
tab
=
1
)
if
variation
:
if
variation
:
categories
.
append
(
variation
)
categories
.
append
(
variation
)
self
.
assertEqual
(
base_price
,
product
.
getPrice
(
categories
=
categories
))
def
sortResult
(
a
,
b
):
def
_pricingSortMethod
(
a
,
b
):
# XXX copied from Resource.py
# Simple method : the one that defines a destination section wins
if
a
.
getDestinationSection
():
return
-
1
# a defines a destination section and wins
return
1
# a defines no destination section and loses
if
_pricingSortMethod
(
a
,
b
):
# now sort based on resource definition
if
a
.
getResourceValue
():
if
b
.
getResourceValue
():
return
1
else
:
return
-
1
else
:
return
1
else
:
return
-
1
self
.
assertEqual
(
base_price
,
product
.
getPrice
(
categories
=
categories
,
sort_method
=
sortResult
))
# The following test tests Movement.getPrice, which is based on the movement
# The following test tests Movement.getPrice, which is based on the movement
...
...
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