Esempio n. 1
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 != {})
Esempio n. 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 != {})
Esempio n. 3
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 != {})
Esempio n. 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 != {})