Page MenuHomePhabricator

TestSharedFiles.test_non_file_local() of file_tests fails because an utm_source was added
Closed, ResolvedPublic

Description

C:\pwb\GIT\core>py -3.13 -m pwb -lang:en file_tests -v TestSharedFiles.test_non_file_local
tests: max_retries reduced from 15 to 3
test_non_file_local (__main__.TestSharedFiles.test_non_file_local)
Test file page, without local file, existing on the local wiki. ... FAIL

======================================================================
FAIL: test_non_file_local (__main__.TestSharedFiles.test_non_file_local)
Test file page, without local file, existing on the local wiki.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\file_tests.py", line 149, in test_non_file_local
    self.assertEqual(testwp_file.get_file_url(),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     commons_file.get_file_url())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'http[59 chars]1.JPG?utm_source=test.wikipedia.org&utm_campai[29 chars]inal' != 'http[59 chars]1.JPG'
- https://upload.wikimedia.org/wikipedia/commons/5/55/Sepp_Maier_1.JPG?utm_source=test.wikipedia.org&utm_campaign=imageinfo&utm_content=original
+ https://upload.wikimedia.org/wikipedia/commons/5/55/Sepp_Maier_1.JPG


----------------------------------------------------------------------
Ran 1 test in 4.521s

FAILED (failures=1)

Event Timeline

Xqt triaged this task as High priority.Mar 21 2026, 5:05 PM
Xqt moved this task from Backlog to CI test failures on the Pywikibot-tests board.
Xqt renamed this task from TestSharedFiles.test_non_file_local() of tile_tests fails because an utm_source was added to TestSharedFiles.test_non_file_local() of file_tests fails because an utm_source was added.Mar 21 2026, 6:38 PM

Change #1257407 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] IMPR: Remove UTM tracking parameter in FilePage.get_file_url()

https://gerrit.wikimedia.org/r/1257407

Change #1257407 merged by jenkins-bot:

[pywikibot/core@master] IMPR: Remove UTM tracking parameter in FilePage.get_file_url()

https://gerrit.wikimedia.org/r/1257407