~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Jonathan Riddell
  • Date: 2011-09-16 11:13:47 UTC
  • mto: This revision was merged to the branch mainline in revision 6144.
  • Revision ID: jriddell@canonical.com-20110916111347-fyjk426bkl0jrbfu
gettext() show_warning usage

Show diffs side-by-side

added added

removed removed

Lines of Context:
745
745
        _test_needs_features = [features.apport]
746
746
 
747
747
 
 
748
Testing translations
 
749
-----------------------
 
750
 
 
751
Translations are disabled by default in tests.  If you want to test
 
752
that code is translated you can use the ``ZzzTranslations`` class from
 
753
``test_i18n``::
 
754
 
 
755
    self.overrideAttr(i18n, '_translations', ZzzTranslations())
 
756
 
 
757
And check the output strings look like ``u"zz\xe5{{output}}"``.
 
758
 
 
759
To test the gettext setup and usage you override i18n.installed back
 
760
to self.i18nInstalled and _translations to None, see
 
761
test_i18n.TestInstall.
 
762
 
 
763
 
748
764
Testing deprecated code
749
765
-----------------------
750
766