Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
23d5343a
Commit
23d5343a
authored
Oct 22, 2013
by
Tatuya Kamada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit Test: Make sure how FloatFiled rounding.
parent
60f94952
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
product/ERP5Form/tests/testFields.py
product/ERP5Form/tests/testFields.py
+9
-0
No files found.
product/ERP5Form/tests/testFields.py
View file @
23d5343a
...
...
@@ -110,6 +110,15 @@ class TestFloatField(ERP5TypeTestCase):
self
.
field
.
values
[
'input_style'
]
=
'-1,234.5'
self
.
field
.
values
[
'precision'
]
=
0
self
.
assertEquals
(
'-1,000'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.25
))
self
.
assertEquals
(
'-1,000'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.49
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.99
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.80
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.70
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.60
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.59
))
self
.
assertEquals
(
'-1,001'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.51
))
# this is not -1,001 (is this a specification?)
self
.
assertEquals
(
'-1,000'
,
self
.
widget
.
format_value
(
self
.
field
,
-
1000.50
))
def
test_format_percent_style
(
self
):
self
.
field
.
values
[
'input_style'
]
=
'-12.3%'
...
...
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