当前位置: 首页>>代码示例>>Python>>正文


Python WikiPage.delete方法代码示例

本文整理汇总了Python中trac.wiki.WikiPage.delete方法的典型用法代码示例。如果您正苦于以下问题:Python WikiPage.delete方法的具体用法?Python WikiPage.delete怎么用?Python WikiPage.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trac.wiki.WikiPage的用法示例。


在下文中一共展示了WikiPage.delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_can_index_version_deleted_event

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
 def test_can_index_version_deleted_event(self):
     #arrange
     self.insert_wiki(self.DUMMY_PAGE_NAME, "version1")
     page = WikiPage(self.env, self.DUMMY_PAGE_NAME)
     page.text = "version 2"
     page.save("anAuthor", "some comment", "::1")
     page.delete(version=2)
     #act
     results = self.search_api.query("*:*")
     #assert
     self.print_result(results)
     self.assertEqual(1, results.hits)
     self.assertEqual("version1", results.docs[0]["content"])
开发者ID:mohsadki,项目名称:dargest,代码行数:15,代码来源:wiki_search.py

示例2: test_delete_page_last_version

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page_last_version(self):
        self.env.db_transaction(
            "INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
            ('TestPage', 1, 42, 'joe', '::1', 'Bla bla', 'Testing', 0))

        page = WikiPage(self.env, 'TestPage')
        page.delete(version=1)

        self.assertFalse(page.exists)

        self.assertEqual([], self.env.db_query("""
            SELECT version, time, author, ipnr, text, comment, readonly
            FROM wiki WHERE name=%s
            """, ('TestPage',)))

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted[0])
开发者ID:exocad,项目名称:exotrac,代码行数:19,代码来源:model.py

示例3: test_delete_page_last_version

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page_last_version(self):
        cursor = self.db.cursor()
        cursor.execute("INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
                       ('TestPage', 1, 42, 'joe', '::1', 'Bla bla', 'Testing',
                        0))

        page = WikiPage(self.env, 'TestPage')
        page.delete(version=1)

        self.assertEqual(False, page.exists)

        cursor.execute("SELECT version,time,author,ipnr,text,comment,"
                       "readonly FROM wiki WHERE name=%s", ('TestPage',))
        self.assertEqual(None, cursor.fetchone())

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted[0])
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:19,代码来源:model.py

示例4: test_delete_page_version

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page_version(self):
        self.env.db_transaction.executemany(
            "INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
            [('TestPage', 1, 42, 'joe', '::1', 'Bla bla', 'Testing', 0),
             ('TestPage', 2, 43, 'kate', '192.168.0.11', 'Bla', 'Changing', 0)])

        page = WikiPage(self.env, 'TestPage')
        page.delete(version=2)

        self.assertTrue(page.exists)
        self.assertEqual(
            [(1, 42, 'joe', '::1', 'Bla bla', 'Testing', 0)],
            self.env.db_query("""
                SELECT version, time, author, ipnr, text, comment, readonly
                FROM wiki WHERE name=%s
                """, ('TestPage',)))

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted_version[0])
开发者ID:exocad,项目名称:exotrac,代码行数:21,代码来源:model.py

示例5: test_delete_page

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page(self):
        cursor = self.db.cursor()
        cursor.execute(
            "INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
            ("TestPage", 1, 42, "joe", "::1", "Bla bla", "Testing", 0),
        )

        page = WikiPage(self.env, "TestPage")
        page.delete()

        self.assertEqual(False, page.exists)

        cursor.execute(
            "SELECT version,time,author,ipnr,text,comment," "readonly FROM wiki WHERE name=%s", ("TestPage",)
        )
        self.assertEqual(None, cursor.fetchone())

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted[0])
开发者ID:cyphactor,项目名称:lifecyclemanager,代码行数:21,代码来源:model.py

示例6: test_delete_page_version

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page_version(self):
        cursor = self.db.cursor()
        cursor.executemany("INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
                           [('TestPage', 1, 42, 'joe', '::1', 'Bla bla',
                            'Testing', 0),
                            ('TestPage', 2, 43, 'kate', '192.168.0.101', 'Bla',
                            'Changing', 0)])

        page = WikiPage(self.env, 'TestPage')
        page.delete(version=2)

        self.assertEqual(True, page.exists)

        cursor.execute("SELECT version,time,author,ipnr,text,comment,"
                       "readonly FROM wiki WHERE name=%s", ('TestPage',))
        self.assertEqual((1, 42, 'joe', '::1', 'Bla bla', 'Testing', 0),
                         cursor.fetchone())
        self.assertEqual(None, cursor.fetchone())

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted_version[0])
开发者ID:gdgkyoto,项目名称:kyoto-gtug,代码行数:23,代码来源:model.py

示例7: test_delete_page_version

# 需要导入模块: from trac.wiki import WikiPage [as 别名]
# 或者: from trac.wiki.WikiPage import delete [as 别名]
    def test_delete_page_version(self):
        cursor = self.db.cursor()
        cursor.executemany(
            "INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
            [
                ("TestPage", 1, 42, "joe", "::1", "Bla bla", "Testing", 0),
                ("TestPage", 2, 43, "kate", "192.168.0.101", "Bla", "Changing", 0),
            ],
        )

        page = WikiPage(self.env, "TestPage")
        page.delete(version=2)

        self.assertEqual(True, page.exists)

        cursor.execute(
            "SELECT version,time,author,ipnr,text,comment," "readonly FROM wiki WHERE name=%s", ("TestPage",)
        )
        self.assertEqual((1, 42, "joe", "::1", "Bla bla", "Testing", 0), cursor.fetchone())
        self.assertEqual(None, cursor.fetchone())

        listener = TestWikiChangeListener(self.env)
        self.assertEqual(page, listener.deleted_version[0])
开发者ID:cyphactor,项目名称:lifecyclemanager,代码行数:25,代码来源:model.py


注:本文中的trac.wiki.WikiPage.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。