nijel/weblate — pull request #459 by vrusinov (2014-03-17 13:27:19+00:00)
Title: Fix test_create_android and other aresource-related tests

They were failing with NameError.

Example:

ERROR: test_import_aresource (weblate.trans.tests.test_commands.ImportProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/tests/test_commands.py", line 89, in test_import_aresource
base_file_template='android/values/strings.xml',
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 161, in call_command
return klass.execute(*args, **defaults)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute
output = self.handle(*args, **options)
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/management/commands/import_project.py", line 177, in handle
options['file_format'], options['base_file_template']
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/management/commands/import_project.py", line 248, in import_initial
filemask=filemask.replace('**', match)
File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 149, in create
return self.get_query_set().create(**kwargs)
File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 416, in create
obj.save(force_insert=True, using=self.db)
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/subproject.py", line 1073, in save
self.create_translations()
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/subproject.py", line 796, in create_translations
self, code, path, force, request=request
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/translation.py", line 64, in check_sync
translation.check_sync(force, request=request)
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/translation.py", line 530, in check_sync
for unit in self.store.all_units():
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/translation.py", line 426, in store
self._store = self.load_store()
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/translation.py", line 410, in load_store
self.subproject.template_store
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/subproject.py", line 1156, in template_store
self._template_store = self.load_template_store()
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/models/subproject.py", line 1143, in load_template_store
self.get_template_filename(),
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/formats.py", line 349, in load
return cls.parse_store(storefile)
File "/home/vrusinov/PycharmProjects/weblate/weblate/trans/formats.py", line 359, in parse_store
'ttkit.%s' % module_name
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/vrusinov/PycharmProjects/weblate/ttkit/aresource.py", line 328, in
class AndroidResourceFile(lisa.LISAfile):
File "/home/vrusinov/PycharmProjects/weblate/ttkit/aresource.py", line 331, in AndroidResourceFile
Name = _("Android String Resource")
NameError: name '_' is not defined