summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-08-18 19:57:50 +0200
committerClaude Paroz <claude@2xlibre.net>2014-08-18 19:57:50 +0200
commit132d0e516e5881cb3f6445e9d84e01c9f2123254 (patch)
treea8e745a733df20374bbd355ff60ee456dc0e29a4 /tests
parenta3d7f58151e4a2996476d400bab0335b8d616bde (diff)
Fixed #22171 -- Improved sanitize_separators cleverness
Thanks Klaas van Schelven for the report and Tim Graham for the review.
Diffstat (limited to 'tests')
-rw-r--r--tests/i18n/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 986b4bfa1e..0599b0b006 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -734,6 +734,12 @@ class FormattingTests(TestCase):
with self.settings(USE_THOUSAND_SEPARATOR=True, USE_L10N=False):
self.assertEqual(sanitize_separators('12\xa0345'), '12\xa0345')
+ with patch_formats(get_language(), THOUSAND_SEPARATOR='.', DECIMAL_SEPARATOR=','):
+ with self.settings(USE_THOUSAND_SEPARATOR=True):
+ self.assertEqual(sanitize_separators('10.234'), '10234')
+ # Suspicion that user entered dot as decimal separator (#22171)
+ self.assertEqual(sanitize_separators('10.10'), '10.10')
+
def test_iter_format_modules(self):
"""
Tests the iter_format_modules function.