Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Binh
erp5
Commits
23d5343a
Commit
23d5343a
authored
11 years ago
by
Tatuya Kamada
Browse files
Options
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%'
...
...
This diff is collapsed.
Click to expand it.
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