コード例 #1
0
ファイル: testi18n.py プロジェクト: alexanbj/viktigpedia
    def test_adding_l10n_decorator_means_model_gets_rendered_to_po_file(self):
        """If a model is created, which is decorated with l10n, it should be added to the po file"""
        self.setup_l10n_model()

        result = ffindgrep(join(settings.LOCALE_DIR, 'locale'), 
            ['^msgid "Ik ben de groot moeftie van cambodja"$'])
        assert(result != {})
コード例 #2
0
    def test_adding_l10n_decorator_means_model_gets_rendered_to_po_file(self):
        """If a model is created, which is decorated with l10n, it should be added to the po file"""
        self.setup_l10n_model()

        result = ffindgrep(join(settings.LOCALE_DIR, 'locale'),
                           ['^msgid "Ik ben de groot moeftie van cambodja"$'])
        assert (result != {})
コード例 #3
0
ファイル: testi18n.py プロジェクト: alexanbj/viktigpedia
 def test_model_to_po(self):
     """A newly created model should be serialized to po"""
     locale_dir = join(settings.LOCALE_DIR, 'locale')
     if isdir(locale_dir):
         shutil.rmtree(locale_dir)
         
     assert(not isdir(locale_dir))
     i = models.TestModel(charfield='ik word serialized to po')
     i.save()
     assert(isdir(locale_dir))
     
     result = ffindgrep(locale_dir, ['^msgid "ik word serialized to po"$'])
     assert(result != {})
コード例 #4
0
    def test_model_to_po(self):
        """A newly created model should be serialized to po"""
        locale_dir = join(settings.LOCALE_DIR, 'locale')
        if isdir(locale_dir):
            shutil.rmtree(locale_dir)

        assert (not isdir(locale_dir))
        i = models.TestModel(charfield='ik word serialized to po')
        i.save()
        assert (isdir(locale_dir))

        result = ffindgrep(locale_dir, ['^msgid "ik word serialized to po"$'])
        assert (result != {})