Merged PR #44, wrote a test

This commit is contained in:
Marco Bonetti 2014-01-15 17:22:38 +01:00
parent 043ace4ebb
commit 78224d7f7c
4 changed files with 54 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Version 0.7.4
-------------
* New ROSETTA_POFILENAMES setting. (PR #44, thanks @wrboyce)
Version 0.7.3
-------------
* Fix for test settings leaking onto global settings: LANGUAGES was overridden and not set back (Issue #81 - Thanks @zsoldosp)

View file

@ -1,4 +1,4 @@
VERSION = (0, 7, 3)
VERSION = (0, 7, 4)
def get_version(svn=False, limit=3):

View file

@ -0,0 +1,27 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Rosetta\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-21 12:21+0200\n"
"PO-Revision-Date: 2008-09-22 11:02\n"
"Last-Translator: Admin Admin <admin@admin.com>\n"
"Language-Team: French <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Translated-Using: django-rosetta 0.4.RC2\n"
msgid "String 1"
msgstr ""
#~ msgid "String 2"
#~ msgstr ""

View file

@ -596,6 +596,28 @@ class RosettaTestCase(TestCase):
except ImproperlyConfigured:
pass
def test_30_pofile_names(self):
POFILENAMES = rosetta_settings.POFILENAMES
rosetta_settings.POFILENAMES = ('pr44.po', )
os.unlink(self.dest_file)
destfile = os.path.normpath(os.path.join(self.curdir, '../locale/xx/LC_MESSAGES/pr44.po'))
shutil.copy(os.path.normpath(os.path.join(self.curdir, './pr44.po.template')), destfile)
self.client.get(reverse('rosetta-pick-file') + '?filter=third-party')
r = self.client.get(reverse('rosetta-home'))
self.assertTrue('xx/LC_MESSAGES/pr44.po' in str(r.content))
r = self.client.get(reverse('rosetta-language-selection', args=('xx', 0,), kwargs=dict()) + '?rosetta')
r = self.client.get(reverse('rosetta-home'))
self.assertTrue('dummy language' in str(r.content))
os.unlink(destfile)
rosetta_settings.POFILENAMES = POFILENAMES
# Stubbed access control function
def no_access(user):
return False