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


Python Milestone.due方法代码示例

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


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

示例1: milestone_setup

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [as 别名]
def milestone_setup(tc):
    boo = Milestone(tc.env)
    boo.name = 'boo'
    boo.completed = boo.due = None
    boo.insert()
    roo = Milestone(tc.env)
    roo.name = 'roo'
    roo.completed = dt_past
    roo.due = None
    roo.insert()
    woo = Milestone(tc.env)
    woo.name = 'woo'
    woo.completed = None
    woo.due = dt_future
    woo.insert()
    zoo = Milestone(tc.env)
    zoo.name = 'zoo'
    zoo.completed = None
    zoo.due = dt_past
    zoo.insert()
开发者ID:exocad,项目名称:exotrac,代码行数:22,代码来源:wikisyntax.py

示例2: milestone_setup

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [as 别名]
def milestone_setup(tc):
    from datetime import datetime
    from trac.util.datefmt import utc
    boo = Milestone(tc.env)
    boo.name = 'boo'
    boo.completed = boo.due = None
    boo.insert()
    roo = Milestone(tc.env)
    roo.name = 'roo'
    roo.completed = datetime.now(utc)
    roo.due = None
    roo.insert()
开发者ID:dafrito,项目名称:trac-mirror,代码行数:14,代码来源:wikisyntax.py

示例3: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [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

示例4: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [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

示例5: test_update_milestone

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [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

示例6: test_get_ticket_fields_milestone_update_due

# 需要导入模块: from trac.ticket.model import Milestone [as 别名]
# 或者: from trac.ticket.model.Milestone import due [as 别名]
    def test_get_ticket_fields_milestone_update_due(self):
        """Cached ticket fields are updated when milestone due date is
        changed.
        """
        fields = self.ticket_system.get_ticket_fields()
        milestone_field = self._get_ticket_field('milestone')
        m2 = Milestone(self.env, 'milestone2')
        m2.due = datetime.now(utc)

        m2.update()
        updated_fields = self.ticket_system.get_ticket_fields()
        updated_milestone_field = self._get_ticket_field('milestone')

        self.assertNotEqual(fields, updated_fields)
        self.assertEqual(['milestone1', 'milestone2',
                          'milestone3', 'milestone4'],
                         milestone_field['options'])
        self.assertEqual(['milestone2', 'milestone1',
                          'milestone3', 'milestone4'],
                         updated_milestone_field['options'])
开发者ID:pkdevbox,项目名称:trac,代码行数:22,代码来源:api.py


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