mirror of
https://github.com/Hopiu/django.git
synced 2026-05-01 04:04:54 +00:00
Refs #27486 -- Added tests for filesizeformat filter.
This commit is contained in:
parent
76b3fc5c8d
commit
53ea535f13
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ class FunctionTests(SimpleTestCase):
|
|||
|
||||
def test_formats(self):
|
||||
tests = [
|
||||
(0, '0\xa0bytes'),
|
||||
(1, '1\xa0byte'),
|
||||
(1023, '1023\xa0bytes'),
|
||||
(1024, '1.0\xa0KB'),
|
||||
(10 * 1024, '10.0\xa0KB'),
|
||||
|
|
@ -28,6 +30,8 @@ class FunctionTests(SimpleTestCase):
|
|||
|
||||
def test_localized_formats(self):
|
||||
tests = [
|
||||
(0, '0\xa0Bytes'),
|
||||
(1, '1\xa0Byte'),
|
||||
(1023, '1023\xa0Bytes'),
|
||||
(1024, '1,0\xa0KB'),
|
||||
(10 * 1024, '10,0\xa0KB'),
|
||||
|
|
@ -50,6 +54,7 @@ class FunctionTests(SimpleTestCase):
|
|||
|
||||
def test_negative_numbers(self):
|
||||
tests = [
|
||||
(-1, '-1\xa0byte'),
|
||||
(-100, '-100\xa0bytes'),
|
||||
(-1024 * 1024 * 50, '-50.0\xa0MB'),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue