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
1 changed files with 6 additions and 0 deletions

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: