jenkins-bot submitted this change.
[cleanup] Remove deprecated Page.getMovedTarget() method
Change-Id: I90f3d87f348e8465d27427ad2f2b6120b426a469
---
M pywikibot/page/__init__.py
M tests/logentries_tests.py
2 files changed, 0 insertions(+), 52 deletions(-)
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 925952e..46d6f9f 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1557,24 +1557,6 @@
"""
return self.site.getredirtarget(self)
- @deprecated('moved_target()', since='20150524', future_warning=True)
- def getMovedTarget(self): # pragma: no cover
- """
- Return a Page object for the target this Page was moved to.
-
- DEPRECATED: Use Page.moved_target().
-
- If this page was not moved, it will raise a NoPage exception.
- This method also works if the source was already deleted.
-
- @rtype: pywikibot.page.Page
- @raises pywikibot.exceptions.NoPage: this page was not moved
- """
- try:
- return self.moved_target()
- except pywikibot.NoMoveTarget:
- raise pywikibot.NoPage(self)
-
def moved_target(self):
"""
Return a Page object for the target this Page was moved to.
diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py
index 5336497..e265212 100644
--- a/tests/logentries_tests.py
+++ b/tests/logentries_tests.py
@@ -318,40 +318,6 @@
self.assertDeprecation() # T271044
self._reset_messages() # T271044
- def test_get_moved_target(self, key):
- """Test getMovedTarget method."""
- # main page was moved around
- if self.sites[key]['target'] is None:
- self.skipTest('No moved target')
- mainpage = self.get_mainpage(self.site)
- target = mainpage.getMovedTarget()
- self.assertIsInstance(target, pywikibot.Page)
- self.assertEqual(target.title(),
- self.sites[key]['target'])
- # main page was moved back again, we test it.
- self.assertEqual(mainpage, target.getMovedTarget())
-
- self.assertOneDeprecationParts(
- 'pywikibot.page.BasePage.getMovedTarget', 'moved_target()', 2)
-
- def test_moved_target_fail_old(self):
- """Test getMovedTarget method failing on older wiki."""
- site = self.get_site('old')
- with self.assertRaises(pywikibot.NoPage):
- self.get_mainpage(site).getMovedTarget()
-
- self.assertOneDeprecationParts(
- 'pywikibot.page.BasePage.getMovedTarget', 'moved_target()')
-
- def test_moved_target_fail_de(self):
- """Test getMovedTarget method failing on de-wiki."""
- page = pywikibot.Page(self.get_site('dewp'), 'Main Page')
- with self.assertRaises(pywikibot.NoPage):
- page.getMovedTarget()
-
- self.assertOneDeprecationParts(
- 'pywikibot.page.BasePage.getMovedTarget', 'moved_target()')
-
if __name__ == '__main__': # pragma: no cover
with suppress(SystemExit):
To view, visit change 666878. To unsubscribe, or for help writing mail filters, visit settings.