Modify ↓
#12822 closed defect (fixed)
TestTicketHistory randomly fails
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.2 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Use url-regexp for |
Description
attachment:TestTicketHistory.html
FAIL: runTest (trac.ticket.tests.functional.main.TestTicketHistory) Test ticket history ---------------------------------------------------------------------- Traceback (most recent call last): File "/run/shm/42f422aebc5dc41d5fb7fe0ebf137c461b3790f3/py27-sqlite/trac/ticket/tests/functional/main.py", line 333, in runTest tc.url(url + re.escape(r'?action=comment-diff&cnum=1&version=1')) File "/run/shm/42f422aebc5dc41d5fb7fe0ebf137c461b3790f3/py27-sqlite/trac/tests/functional/better_twill.py", line 243, in better_url (to_unicode(e), filename)) TwillAssertionError: current url is 'http://127.0.0.1:8594/ticket/35?action=diff&version=1'; does not match 'http://127.0.0.1:8594/ticket/35\?action\=comment\-diff\&cnum\=1\&version\=1' at file:///run/shm/42f422aebc5dc41d5fb7fe0ebf137c461b3790f3/py27-sqlite/testenv/trac/log/TestTicketHistory.html
Attachments (1)
Change History (7)
by , 8 years ago
Attachment: | TestTicketHistory.html added |
---|
comment:1 by , 8 years ago
comment:3 by , 8 years ago
Milestone: | next-dev-1.3.x → 1.3.2 |
---|
Another fix, we could use url-regexp rather than text-regexp. tc.follow()
accepts url-regexp.
-
trac/ticket/tests/functional/main.py
commit a44eea31da7bb879f4fba878e13e38c8fc292c7d Author: Jun Omae <jun66j5@gmail.com> Date: Sun May 28 00:24:13 2017 +0900 (#12821) use url-regexp for `tc.follow()` rather than text-regexp to avoid following incorrect diff link diff --git a/trac/ticket/tests/functional/main.py b/trac/ticket/tests/functional/main.py index 039c1e9eb..04b94d044 100755
a b class TestTicketHistory(FunctionalTwillTestCaseSetup): 327 327 tc.url(url + re.escape(r'?cversion=1&cnum_hist=1#comment:1')) 328 328 329 329 # View comment diff. 330 tc.follow(r"\bdiff\b") 330 tc.follow(r'^/ticket/%s\?action=comment-diff&cnum=1&version=1$' % 331 ticketid) 331 332 tc.notfind(r"\bComment:\b") 332 333 tc.find(r"\bChanges between\b") 333 334 tc.url(url + re.escape(r'?action=comment-diff&cnum=1&version=1'))
comment:4 by , 8 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:5 by , 8 years ago
Owner: | set to |
---|
comment:6 by , 5 years ago
Note:
See TracTickets
for help on using tickets.
The ticket's description is rarely modified by adding
The original comment
at trunk/trac/ticket/tests/functional/main.py@15930:281#L276 (~1%). This behavior leads anotherdiff
link for the description. As the result,tc.follow(r"\bdiff\b")
follows incorrect link.I guess that is a twill issue.
Work around is to make the description field empty.
trac/ticket/tests/functional/main.py
)