| Xqt created this task. Xqt added projects: Pywikibot-tests, Pywikibot. Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. |
TASK DESCRIPTION
=================================== FAILURES =================================== _________________ TestPageBotMayEdit.test_bot_may_edit_general _________________
self = <tests.page_tests.TestPageBotMayEdit testMethod=test_bot_may_edit_general>
@mock.patch.object(config, 'ignore_bot_templates', False)
def test_bot_may_edit_general(self):
"""Test that bot is allowed to edit."""
site = self.get_site()
user = site.user()
page = pywikibot.Page(site, 'not_existent_page_for_pywikibot_tests')
if page.exists():
raise unittest.SkipTest(
'Page {} exists! Change page name in tests/page_tests.py'
.format(page.title()))
# Ban all compliant bots (shortcut).
page.text = '{{nobots}}'
page._templates = [pywikibot.Page(site, 'Template:Nobots')]
self.assertFalse(page.botMayEdit())
# Ban all compliant bots not in the list, syntax for de wp.
page.text = '{{nobots|HagermanBot,Werdnabot}}'
self.assertTrue(page.botMayEdit(),
'{}: {} but user={}'
.format(page.text, page.botMayEdit(), user))
# Ban all compliant bots not in the list, syntax for de wp.
page.text = '{{nobots|{}, HagermanBot,Werdnabot}}'.format(user)
self.assertFalse(page.botMayEdit(),
'{}: {} but user={}'
> .format(page.text, page.botMayEdit(), user))
E AssertionError: {nobots|Pywikibot-test, HagermanBot,Werdnabot}: True but user=Pywikibot-testTASK DETAIL
EMAIL PREFERENCES
To: Xqt
Cc: Dalba, D3r1ck01, Aklapper, Xqt, pywikibot-bugs-list, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
Cc: Dalba, D3r1ck01, Aklapper, Xqt, pywikibot-bugs-list, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
