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 != {})
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 != {})
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 != {})
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 != {})