def test_0020_kwargs(self): """ Test if kwargs work """ with Transaction().start(testing_proxy.db_name, 1, None): s = _("Hi %(name)s", name="Sharoon") self.assertEqual(s, u"Hi Sharoon") with Transaction().set_context(language="pt_BR"): self.assertEqual(s, u'Oi Sharoon')
def test_0010_simple_txn(self): """ Test if the translations work in a simple env """ with Transaction().start(testing_proxy.db_name, 1, None): s = _("en_US") self.assertEqual(s, u'en_US') with Transaction().set_context(language="pt_BR"): self.assertEqual(s, u'pt_BR')
def test_0020_kwargs(self): """ Test if kwargs work """ with Transaction().start(DB_NAME, USER, CONTEXT): s = _("Hi %(name)s", name="Sharoon") self.assertEqual(s, u"Hi Sharoon") with Transaction().set_context(language="pt_BR"): self.assertEqual(s, u'Oi Sharoon')
def test_0010_simple_txn(self): """ Test if the translations work in a simple env """ with Transaction().start(DB_NAME, USER, CONTEXT): s = _("en_US") self.assertEqual(s, u'en_US') with Transaction().set_context(language="pt_BR"): self.assertEqual(s, u'pt_BR')