0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Added tests for trans_null.ngettext().

This commit is contained in:
Hasan Ramezani 2018-05-08 18:48:33 +04:30 committed by Tim Graham
parent c629d4e956
commit 7ba040de77

View File

@ -86,6 +86,12 @@ class TranslationTests(SimpleTestCase):
self.assertEqual(ngettext("%(size)d byte", "%(size)d bytes", 0) % {'size': 0}, "0 octet")
self.assertEqual(ngettext("%(size)d byte", "%(size)d bytes", 2) % {'size': 2}, "2 octets")
def test_plural_null(self):
g = trans_null.ngettext
self.assertEqual(g('%d year', '%d years', 0) % 0, '0 years')
self.assertEqual(g('%d year', '%d years', 1) % 1, '1 year')
self.assertEqual(g('%d year', '%d years', 2) % 2, '2 years')
def test_override(self):
activate('de')
try: