tests.page_tests module#
Tests for the page module.
- class tests.page_tests.HtmlEntity(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test that HTML entities are correctly decoded.
- abstract_class = False#
- class tests.page_tests.TestApplicablePageProtections(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test applicable restriction types.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestLinkObject(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,SiteAttributeTestCase
Test cases for Link objects.
- abstract_class = False#
- cached = True#
- namespaces = {0: [''], 1: ['Talk:'], 2: ['User:'], 3: ['User talk:', 'User_talk:'], 4: ['Wikipedia:', 'Project:', 'WP:'], 5: ['Wikipedia talk:', 'Project talk:', 'Wikipedia_talk:', 'Project_talk:', 'WT:'], 6: ['File:'], 7: ['Image talk:', 'Image_talk:'], 8: ['MediaWiki:'], 9: ['MediaWiki talk:', 'MediaWiki_talk:'], 10: ['Template:'], 11: ['Template talk:', 'Template_talk:'], 12: ['Help:'], 13: ['Help talk:', 'Help_talk:'], 14: ['Category:'], 15: ['Category talk:', 'Category_talk:'], 100: ['Portal:'], 101: ['Portal talk:', 'Portal_talk:']}#
- net = True#
- site = True#
- sites = {'enwiki': {'code': 'en', 'family': 'wikipedia'}, 'enws': {'code': 'en', 'family': 'wikisource'}, 'frwiki': {'code': 'fr', 'family': 'wikipedia'}, 'itwikt': {'code': 'it', 'family': 'wiktionary'}, 'itws': {'code': 'it', 'family': 'wikisource'}}#
- titles = {'Cities in Burkina Faso': 'Cities in Burkina Faso', 'Hispanic (U.S. Census)': 'Hispanic (U.S. Census)', 'Nowy_Sącz': 'Nowy Sącz', 'Stołpce': 'Stołpce', 'The_Addams_Family_(pinball)': 'The Addams Family (pinball)', 'battle of Węgierska Górka': 'Battle of Węgierska Górka', 'eastern Sayan': 'Eastern Sayan'}#
- class tests.page_tests.TestPageBotMayEdit(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test Page.botMayEdit() method.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageCoordinates(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test Page Object using German Wikipedia.
- abstract_class = False#
- cached = True#
- code = 'de'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:de': {'code': 'de', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageDelete(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,NeedRightsMixin
,SiteWriteMixin
,CheckHostnameMixin
,TestCase
Test page delete / undelete actions.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- rights = 'delete'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- write = True#
- class tests.page_tests.TestPageGetFileHistory(*args, **kwargs)[source]#
Bases:
DisconnectedSiteMixin
,DefaultDrySiteTestCase
Test the get_file_history method of the FilePage class.
- abstract_class = False#
- code = 'test'#
- dry = True#
- family = 'wikipedia'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageHistory(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test history related functionality.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageObject(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,DefaultSiteTestCase
Test Page object.
- abstract_class = False#
- cached = True#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageObjectEnglish(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test Page Object using English Wikipedia.
- abstract_class = False#
- cached = True#
- code = 'en'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageProtect(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,NeedRightsMixin
,SiteWriteMixin
,CheckHostnameMixin
,TestCase
Test page protect / unprotect actions.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- rights = 'protect'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- write = True#
- class tests.page_tests.TestPageRedirects(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,ForceCacheMixin
,TestCase
Test redirects.
This is using the pages ‘User:Legoktm/R1’, ‘User:Legoktm/R2’ and ‘User:Legoktm/R3’ on the English Wikipedia. ‘R1’ is redirecting to ‘R2’, ‘R2’ is a normal page and ‘R3’ does not exist.
- abstract_class = False#
- cached = True#
- net = True#
- site = True#
- sites = {'en': {'code': 'en', 'family': 'wikipedia'}, 'test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageRepr(*args, **kwargs)[source]#
Bases:
DisconnectedSiteMixin
,DefaultDrySiteTestCase
Test for Page’s repr implementation.
- abstract_class = False#
- code = 'test'#
- dry = True#
- family = 'wikipedia'#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPageUserAction(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,DefaultSiteTestCase
Test page user actions.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestPermalink(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test that permalink links are correct.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
- class tests.page_tests.TestShortLink(*args, **kwargs)[source]#
Bases:
RequireLoginMixin
,CheckHostnameMixin
,TestCase
Test that short link management is correct.
- abstract_class = False#
- code = 'test'#
- family = 'wikipedia'#
- login = True#
- net = True#
- site = True#
- sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#