#26687: i18n symlinked .po test: Fix assertion which is wrong for Windows
-------------------------------------+-------------------------------------
Reporter: ramiro | Owner: ramiro
Type: Bug | Status: new
Component: | Version: master
Internationalization | Keywords: windows i18n
Severity: Normal | symlink os.symlink
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
On currently supoorted Python 3.x versions, the
`i18n.test_extraction.SymlinkExtractorTests.test_symlink` test case fails
when run on Windows with:
{{{
[00:08:26]
======================================================================
[00:08:26] FAIL: test_symlink (i18n.test_extraction.SymlinkExtractorTests)
[00:08:26]
----------------------------------------------------------------------
[00:08:26] Traceback (most recent call last):
[00:08:26] File "C:\projects\django\tests\i18n\test_extraction.py", line
557, in test_symlink
[00:08:26] AssertionError: 'templates_symlinked/test.html' not found in '#
SOME DESCRIPTIV
[00:08:26] E TITLE.\n# Copyright (C) YEAR THE PACKAGE\'S COPYRIGHT
HOLDER\n# This file is distributed under the same license as the PACKAGE
package.\n# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n#\n#, fuzzy\nmsgid
""\nmsgstr ""\n"Project-Id-Version: PACKAGE VERSION\\n"\n"Report-Msgid-
Bugs-To: \\n"\n"POT-Creation-Date: 2016-05-30 09:33+0000\\n"\n"PO-
Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"\n"Last-Translator: FULL NAME
<EMAIL@ADDRESS>\\n"\n"Language-Team: LANGUAGE <[email protected]>\\n"\n"Language:
\\n"\n"MIME-Version: 1.0\\n"\n"Content-Type: text/plain;
charset=UTF-8\\n"\n"Content-Transfer-Encoding: 8bit\\n"\n"Plural-Forms:
nplurals=2; plural=(n != 1);\\n"\n\n#. Translators: This comment should be
extracted\n#: .\\__init__.py:4\nmsgid "This is a translatable
string."\nmsgstr ""\n\n#: .\\__init__.py:7\nmsgid "This is another
translatable string."\nmsgstr ""\n\n#: .\\__init__.py:12\n#, python-
format\nmsgid "%(number)s Foo"\nmsgid_plural "%(number)s Foos"\nmsgstr[0]
""\nmsgstr[1] ""\n\n#: .\\__init__.py:14\nmsgid "Size"\nmsgstr ""\n\n#.
[00:08:26] Translators: Django comment block for translators\n#.
string\'s meaning unveiled\n#: .\\__init__.py:17 .\\templates\\test.html:5
.\\templates\\test.html:76\n#: .\\templates_symlinked\\test.html:5
.\\templates_symlinked\\test.html:76\nmsgid "This literal should be
...
}}}
This is easily fixable by replacing the assert, as we already do in other
test cases, to check for a PO location comment that can have non-Unix path
separators.
This was uncovered by running our tests on Appveyor:
https://ci.appveyor.com/project/ramiro/django/build/34/job/6e9dawga1awks006#L105
Because there they are run as the Windows Administrator account (one of
the conditions necessary to actually reach the assert for this platform),
something which usually doesn't happen on a developer workstation.
--
Ticket URL: <https://code.djangoproject.com/ticket/26687>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.c6a4c94a4018136159c64136cd26d839%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.