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