本文整理汇总了Python中trac.ticket.query.Query.count方法的典型用法代码示例。如果您正苦于以下问题:Python Query.count方法的具体用法?Python Query.count怎么用?Python Query.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.ticket.query.Query
的用法示例。
在下文中一共展示了Query.count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_trac
# 需要导入模块: from trac.ticket.query import Query [as 别名]
# 或者: from trac.ticket.query.Query import count [as 别名]
def test_trac(build_trac_env):
"""Create a sample Ticket and check if
the Ticket-Count == 1
"""
env = build_trac_env
env_dict = {}
env_dict['trac.base_url'] = 'http://127.0.0.1:8000/trac/'
# Create the Request
req = Request(env_dict, None)
req.authname = 'JohnDoe'
req.perm = 'TICKET_ADMIN'
req.tz = 42
req.locale = 42
# Create a Ticket
t = model.Ticket(env)
t['summary'] = 'Summary'
t['description'] = 'Description'
t['reporter'] = req.authname
t['status'] = 'new'
t['resolution'] = ''
t.insert()
# Count Tickets
q = Query(env)
qc = q.count(req)
assert qc == 1