#12850 closed defect (fixed)
Test failure with trac.wiki.tests.functional.TestWikiDelete — at Version 3
Reported by: | Ryan J Ollos | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | wiki system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix wrong msgid_plural in wiki_delete.html. |
||
API Changes: | |||
Internal Changes: |
Description
Failure seen on AppVeyor and Travis CI.
====================================================================== FAIL: runTest (trac.wiki.tests.functional.TestWikiDelete) Delete a wiki page. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/edgewall/trac/trac/wiki/tests/functional.py", line 76, in runTest r'version=2">all 2 versions</a>\s+of the page' % name) File "/home/travis/build/edgewall/trac/trac/tests/functional/better_twill.py", line 224, in better_find (to_unicode(e), filename)) TwillAssertionError: no match to 'Removing\s+<a href="/wiki/BagpipeTongue\?action=history&version=2">all 2 versions</a>\s+of the page' at file:///home/travis/build/edgewall/trac/testenv/trac/log/TestWikiDelete.html ---------------------------------------------------------------------- Ran 222 tests in 677.196s FAILED (failures=1) make: *** [functional-test] Error 1
Change History (3)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
extract_messages
command's behavior is right. msgid_plural
is used only when messages catalog is not found for active language. msgid
is used as a key and must be unique without msgid_plural
. Therefore, usage of ngettext
in wiki_delete.html is wrong.
-
trac/wiki/templates/wiki_delete.html
diff --git a/trac/wiki/templates/wiki_delete.html b/trac/wiki/templates/wiki_delete.html index d9b68553c..172e87830 100644
a b 130 130 # else: 131 131 # set num_versions 132 132 <a href="${history_href}">${ 133 ngettext("%(num)d version", " all%(num)d versions", num=num_versions)133 ngettext("%(num)d version", "%(num)d versions", num=num_versions) 134 134 }</a> 135 135 # endset 136 136 # trans num_versions, created = first_modified, modified = last_modified 137 137 138 Removing ${num_versions} of the page, which was created138 Removing all ${num_versions} of the page, which was created 139 139 ${created} and last modified ${modified}. 140 140 141 141 # endtrans -
trac/wiki/tests/functional.py
diff --git a/trac/wiki/tests/functional.py b/trac/wiki/tests/functional.py index 292099581..a46c5d769 100755
a b class TestWikiDelete(FunctionalTwillTestCaseSetup): 72 72 tc.formvalue('delete', 'action', 'delete') 73 73 tc.submit('delete_page') 74 74 tc.find("Are you sure you want to completely delete this page?") 75 tc.find(r'Removing \s+<a href="/wiki/%s\?action=history&'76 r'version=2"> all2 versions</a>\s+of the page' % name)75 tc.find(r'Removing all\s+<a href="/wiki/%s\?action=history&' 76 r'version=2">2 versions</a>\s+of the page' % name) 77 77 tc.notfind("The following attachments will also be deleted:") 78 78 tc.submit('delete', 'delete-confirm') 79 79 tc.find("The page %s has been deleted." % name)
comment:3 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [16076].
Note:
See TracTickets
for help on using tickets.
ngettext()
is used in wiki_delete.html like this:extract_messages
command extracts"%(num)d version"
and"%(num)d versions"
from the above but"all %(num)d versions"
is not extracted.