-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: return DecimalFields as decimal instead of string. ref #368
- Loading branch information
Showing
4 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.test import TestCase | ||
|
||
from open_prices.common.utils import is_float | ||
|
||
|
||
class UtilsTest(TestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
pass | ||
|
||
def test_is_float(self): | ||
for PRICE_OK in [0, 1.5, 10, "0", "1.5", "10.00"]: | ||
self.assertTrue(is_float(PRICE_OK)) | ||
for PRICE_NOT_OK in ["", " ", "a", "1,5", "1.5.0"]: | ||
self.assertFalse(is_float(PRICE_NOT_OK)) |