Page MenuHomePhabricator

All tests fail for TestPageBotMayEdit.test_bot_may_edit_general
Closed, ResolvedPublic

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-test

Event Timeline

Xqt triaged this task as High priority.Oct 1 2018, 10:51 AM

Change 463726 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Fix failing tests of TestPageBotMayEdit.test_bot_may_edit_general

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

Change 463726 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix failing tests of TestPageBotMayEdit.test_bot_may_edit_general

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