jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Data: Use site's language and not code
......................................................................
[FIX] Data: Use site's language and not code
Previously date.py was using the site's code which is not always the
same as the language, especially when they are projects which don't have
extra sites for the different languages. This is now using the site's
language.
To get the site's language a siteinfo request must be done so the two
tests which were failing previously must be now non-dry tests.
Bug: T85645
Change-Id: I8b7efd0cdd2ef5fa65ab57c2f47415932cb7d34b
---
M pywikibot/date.py
M tests/pagegenerators_tests.py
2 files changed, 1 insertion(+), 11 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 0fcaa0e..36dc254 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -2334,7 +2334,7 @@
self.site = site
def __call__(self, m, d):
- return formats['Day_' + enMonthNames[m-1]][self.site.code](d)
+ return formats['Day_' + enMonthNames[m-1]][self.site.lang](d)
def formatYear(lang, year):
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 3c4e632..4cc227c 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -283,13 +283,8 @@
"""Test the year page generator."""
- dry = True
-
def test_basic(self):
site = self.get_site()
- # Skip if its wikidata because T85645
- if site.family == "wikidata":
- raise unittest.SkipTest('date.py does not support wikidata')
# Some languages are missing (T85681)
if (site.language() not in date.formats['YearBC']) or (site.language() not in date.formats['YearAD']):
raise unittest.SkipTest('Date formats for this language are missing from date.py')
@@ -311,13 +306,8 @@
"""Test the day page generator."""
- dry = True
-
def test_basic(self):
site = self.get_site()
- # Skip if its wikidata because T85645
- if site.family == "wikidata":
- raise unittest.SkipTest
fd = date.FormatDate(site)
startMonth = 1
endMonth = 12
--
To view, visit https://gerrit.wikimedia.org/r/182453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8b7efd0cdd2ef5fa65ab57c2f47415932cb7d34b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for xZise/pywikibot-core
-------------------------------------
Build: #17
Status: Fixed
Duration: 40 minutes and 55 seconds
Commit: 5897063 (conditional-rc-test)
Author: Fabian Neundorf
Message: [FIX] Pagegen test: Only do LiveRC test if installed
If socketIO_client is not installed, the live RC tests should be
skipped.
Change-Id: I77e72d71244b940ff543a4cd819d875a7d231a3d
View the changeset: https://github.com/xZise/pywikibot-core/compare/1d457f33b8ac...589706397baf
View the full build log and details: https://travis-ci.org/xZise/pywikibot-core/builds/45683381
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
Build Update for xZise/pywikibot-core
-------------------------------------
Build: #16
Status: Failed
Duration: 39 minutes and 42 seconds
Commit: 1d457f3 (conditional-rc-test)
Author: Fabian Neundorf
Message: [FIX] Pagegen test: Only do LiveRC test if installed
If socketIO_client is not installed, the live RC tests should be
skipped.
Change-Id: I77e72d71244b940ff543a4cd819d875a7d231a3d
View the changeset: https://github.com/xZise/pywikibot-core/commit/1d457f33b8ac
View the full build log and details: https://travis-ci.org/xZise/pywikibot-core/builds/45677602
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications