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


Python Milestone.description方法代码示例

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


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

示例1: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import description [as 别名]
    def test_update_milestone(self):
        cursor = self.db.cursor()
        cursor.execute("INSERT INTO milestone (name) VALUES ('Test')")
        cursor.close()

        milestone = Milestone(self.env, 'Test')
        milestone.due = 42
        milestone.completed = 43
        milestone.description = 'Foo bar'
        milestone.update()

        cursor = self.db.cursor()
        cursor.execute("SELECT * FROM milestone WHERE name='Test'")
        self.assertEqual(('Test', 42, 43, 'Foo bar'), cursor.fetchone())
开发者ID:cyphactor,项目名称:lifecyclemanager,代码行数:16,代码来源:model.py

示例2: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import description [as 别名]
    def test_update_milestone(self):
        self.env.db_transaction("INSERT INTO milestone (name) VALUES ('Test')")

        milestone = Milestone(self.env, 'Test')
        t1 = datetime(2001, 01, 01, tzinfo=utc)
        t2 = datetime(2002, 02, 02, tzinfo=utc)
        milestone.due = t1
        milestone.completed = t2
        milestone.description = 'Foo bar'
        milestone.update()

        self.assertEqual(
            [('Test', to_utimestamp(t1), to_utimestamp(t2), 'Foo bar')],
            self.env.db_query("SELECT * FROM milestone WHERE name='Test'"))
开发者ID:thimalk,项目名称:bloodhound,代码行数:16,代码来源:model.py

示例3: test_create_and_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import description [as 别名]
    def test_create_and_update_milestone(self):
        milestone = Milestone(self.env)
        milestone.name = "Test"
        milestone.insert()

        cursor = self.db.cursor()
        cursor.execute("SELECT name,due,completed,description FROM milestone " "WHERE name='Test'")
        self.assertEqual(("Test", 0, 0, ""), cursor.fetchone())

        # Use the same model object to update the milestone
        milestone.description = "Some text"
        milestone.update()
        cursor.execute("SELECT name,due,completed,description FROM milestone " "WHERE name='Test'")
        self.assertEqual(("Test", 0, 0, "Some text"), cursor.fetchone())
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:16,代码来源:model.py

示例4: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import description [as 别名]
    def test_update_milestone(self):
        cursor = self.db.cursor()
        cursor.execute("INSERT INTO milestone (name) VALUES ('Test')")
        cursor.close()

        milestone = Milestone(self.env, "Test")
        t1 = datetime(2001, 01, 01, tzinfo=utc)
        t2 = datetime(2002, 02, 02, tzinfo=utc)
        milestone.due = t1
        milestone.completed = t2
        milestone.description = "Foo bar"
        milestone.update()

        cursor = self.db.cursor()
        cursor.execute("SELECT * FROM milestone WHERE name='Test'")
        self.assertEqual(("Test", to_utimestamp(t1), to_utimestamp(t2), "Foo bar"), cursor.fetchone())
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:18,代码来源:model.py

示例5: test_create_and_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import description [as 别名]
    def test_create_and_update_milestone(self):
        milestone = Milestone(self.env)
        milestone.name = 'Test'
        milestone.insert()

        self.assertEqual([('Test', 0, 0, '')], self.env.db_query("""
            SELECT name, due, completed, description FROM milestone
            WHERE name='Test'
            """))

        # Use the same model object to update the milestone
        milestone.description = 'Some text'
        milestone.update()
        self.assertEqual([('Test', 0, 0, 'Some text')], self.env.db_query("""
            SELECT name, due, completed, description FROM milestone
            WHERE name='Test'
            """))
开发者ID:thimalk,项目名称:bloodhound,代码行数:19,代码来源:model.py


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