Beispiel #1
0
 def test_summary(self):
     """Test automatic (un)protection summary on the test wiki."""
     site = self.get_site()
     protect.main('-cat:Pywikibot Protect Test', '-always', '-default')
     protect.main('-cat:Pywikibot Protect Test', '-always', '-unprotect')
     protect.main('-cat:Pywikibot Protect Test', '-always', '-default')
     page = pywikibot.Page(site, 'User:Sn1per/ProtectTest2')
     rev = list(page.revisions())
     self.assertEqual(
         rev[1].comment,
         'Removed protection from "[[User:Sn1per/ProtectTest2]]": Bot: '
         'Unprotecting all pages from category Pywikibot Protect Test')
     self.assertEqual(
         rev[0].comment, 'Protected "[[User:Sn1per/ProtectTest2]]": Bot: '
         'Protecting all pages from category Pywikibot Protect Test '
         '([Edit=Allow only administrators] (indefinite) [Move=Allow only '
         'administrators] (indefinite))')
 def test_summary(self):
     """Test automatic (un)protection summary on the test wiki."""
     site = self.get_site()
     protect.main("-cat:Pywikibot Protect Test", "-always", "-default")
     protect.main("-cat:Pywikibot Protect Test", "-always", "-unprotect")
     protect.main("-cat:Pywikibot Protect Test", "-always", "-default")
     page = pywikibot.Page(site, "User:Sn1per/ProtectTest2")
     rev = list(page.revisions())
     self.assertEqual(
         rev[1].comment,
         'Removed protection from "[[User:Sn1per/ProtectTest2]]": Bot: '
         "Unprotecting all pages from category Pywikibot Protect Test",
     )
     self.assertEqual(
         rev[0].comment,
         'Protected "[[User:Sn1per/ProtectTest2]]": Bot: '
         "Protecting all pages from category Pywikibot Protect Test "
         "([Edit=Allow only administrators] (indefinite) [Move=Allow only "
         "administrators] (indefinite))",
     )
 def test_summary(self):
     """Test automatic (un)protection summary on the test wiki."""
     site = self.get_site()
     protect.main('-cat:Pywikibot Protect Test', '-always',
                  '-default')
     protect.main('-cat:Pywikibot Protect Test', '-always',
                  '-unprotect')
     protect.main('-cat:Pywikibot Protect Test', '-always',
                  '-default')
     page = pywikibot.Page(site, 'User:Sn1per/ProtectTest2')
     rev = list(page.revisions())
     self.assertEqual(
         rev[1].comment,
         'Removed protection from "[[User:Sn1per/ProtectTest2]]": Bot: '
         'Unprotecting all pages from category Pywikibot Protect Test')
     self.assertEqual(
         rev[0].comment,
         'Protected "[[User:Sn1per/ProtectTest2]]": Bot: '
         'Protecting all pages from category Pywikibot Protect Test '
         '([Edit=Allow only administrators] (indefinite) [Move=Allow only '
         'administrators] (indefinite))')