本文整理汇总了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()
示例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()
示例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())
示例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'"))
示例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())
示例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'])