本文整理汇总了Python中trac.tests.functional.tc.url函数的典型用法代码示例。如果您正苦于以下问题:Python url函数的具体用法?Python url怎么用?Python url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了url函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runTest
def runTest(self):
team_name = 'team_for_capacity_saving'
member_name = 'Team member_name'
sprint_name = 'capacity_saving_sprint'
self._tester.login_as(Usernames.admin)
self._tester.create_new_team(team_name)
self._tester.add_member_to_team(team_name, member_name)
sprint_start = now()
self._tester.create_sprint_via_admin(sprint_name, start=sprint_start, team=team_name)
# having tasks with remaining time which were not assigned to a specific
# user triggered another bug on the team page.
attributes = dict(sprint=sprint_name, remaining_time='12')
self._tester.create_new_agilo_task('Not assigned Task', **attributes)
self._tester.login_as(Usernames.scrum_master)
self._tester.go_to_team_page(team_name, sprint_name)
team_page_url = tc.get_browser().get_url()
day_ordinal = (sprint_start + timedelta(days=3)).toordinal()
input_name = 'ts_%s_%d' % (member_name, day_ordinal)
tc.formvalue('team_capacity_form', input_name, '2')
tc.submit('save')
tc.code(200)
tc.url(team_page_url)
示例2: runTest
def runTest(self):
self._tester.login_as(Usernames.admin)
# get page for editing requirement ticket type
page_url = self._tester.url + '/admin/agilo/types/requirement'
tc.go(page_url)
tc.url(page_url)
tc.code(200)
tc.find('requirement')
tc.find('Alias:')
# test default field
tc.find('name="fields" value="businessvalue" checked="checked"')
# change alias and fields and save
tc.formvalue('modcomp', 'fields', '+priority')
tc.formvalue('modcomp', 'fields', '-businessvalue')
tc.formvalue('modcomp', 'fields', '-milestone')
tc.formvalue('modcomp', 'fields', '-keywords')
tc.submit('save')
# redirects to list page, now only the priority should be selected
tc.find('<td class="fields">[\n ]*Priority<br />[\n ]*</td>')
tc.go(page_url)
# We must ensure that these fields are available for later tests.
tc.formvalue('modcomp', 'fields', '+businessvalue')
tc.formvalue('modcomp', 'fields', '+milestone')
tc.submit('save')
示例3: _test_adding_a_backlog
def _test_adding_a_backlog(self, page_url, backlog_name):
tc.go(page_url)
tc.url(page_url)
tc.fv('addbacklog', 'name', backlog_name)
tc.submit('add')
# we're at the edit page
backlog_url = page_url + '/' + backlog_name
tc.url(backlog_url)
示例4: runTest
def runTest(self):
"""Admin remove version"""
name = "VersionRemove"
self._tester.create_version(name)
version_url = self._tester.url + "/admin/ticket/versions"
tc.go(version_url)
tc.formvalue('version_table', 'sel', name)
tc.submit('remove')
tc.url(version_url + '$')
tc.notfind(name)
示例5: runTest
def runTest(self):
"""Check empty repository"""
browser_url = self._tester.url + "/browser"
tc.go(browser_url)
tc.url(browser_url)
# This tests the current behavior; I'm not sure it's the best
# behavior.
tc.follow("Last Change")
tc.find("Error: No such changeset")
tc.back()
tc.follow("Revision Log")
tc.notfind("Error: Nonexistent path")
示例6: runTest
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/11438
fix for log: link with revision ranges included "head" keyword
"""
rev = self._testenv.svn_mkdir(['ticket11438'], '')
rev = self._testenv.svn_add('ticket11438/file1.txt', '')
rev = self._testenv.svn_add('ticket11438/file2.txt', '')
tc.go(self._tester.url + '/intertrac/log:@%d:head' % (rev - 1))
tc.url(self._tester.url + r'/log/\?revs=' + str(rev - 1) + '-head')
tc.notfind('@%d' % (rev + 1))
tc.find('@%d' % rev)
tc.find('@%d' % (rev - 1))
tc.notfind('@%d' % (rev - 2))
示例7: runTest
def runTest(self):
self._tester.login_as(Usernames.admin)
self._tester.delete_custom_field('remaining_time', 'Remaining Time')
# add the field again
tc.formvalue('addcf', 'name', 'remaining_time')
# don't put a value in label field, test empty value
tc.submit('add')
tc.code(200)
tc.url(self._tester.url + '/admin/agilo/fields')
# redirects to list page, now link with default label
# should be found again
tc.find('<td><a href="/admin/agilo/fields/remaining_time">remaining_time')
tc.find('<td>Remaining_time</td>', 'm')
last = self._get_number_of_custom_fields()
self._assert_field_has_number('remaining_time', last)
self._tester.modify_custom_field('remaining_time', label='Linking Source')
# see if the new label is found
tc.find('<td>Linking Source</td>')
# add another field
tc.formvalue('addcf', 'name', 'testfield')
tc.formvalue('addcf', 'label', 'Test Field')
tc.submit('add')
# see if the new label is found
tc.find('<td><a href="/admin/agilo/fields/testfield">testfield')
tc.find('<td>Test Field</td>')
tc.code(200)
# set order of fields
last = self._get_number_of_custom_fields()
# There are 7 standard fields, so these new ones should be 7 and 8.
ord1 = str(last - 1)
ord2 = str(last)
# check the actual position of the two custom fields
self._assert_field_has_number('remaining_time', ord1)
self._assert_field_has_number('testfield', ord2)
# Change the order
tc.formvalue('customfields', 'order_testfield', ord1)
tc.formvalue('customfields', 'order_remaining_time', ord2)
tc.submit('apply')
# has the order been changed? This regex finds the order select field
# for testfield and the selected option -> should be 8
tc.find('<select name="order_remaining_time">(</*option>|\s|\d)*' \
'<option selected="selected">\s*' + ord2, 'm')
tc.find('<select name="order_testfield">(</*option>|\s|\d)*' \
'<option selected="selected">\s*' + ord1, 'm')
示例8: runTest
def runTest(self):
self._tester.login_as(Usernames.admin)
# Create the milestone first
self._tester.create_milestone('milestone2')
# get sprint listing, should be empty
page_url = self._tester.url + '/admin/agilo/sprints'
tc.go(page_url)
tc.url(page_url)
tc.code(200)
# add new sprint
sprint_start = normalize_date(now())
sprint_name = 'Test sprint'
tc.formvalue('addsprint', 'name', sprint_name)
tc.formvalue('addsprint', 'start', format_datetime(sprint_start, format='iso8601'))
tc.formvalue('addsprint', 'duration', '1')
tc.formvalue('addsprint', 'milestone', 'milestone2')
tc.submit('add')
# add redirects to list view, new sprint should be in there
tc.find(sprint_name)
# go to detail page
tc.go("%s/%s" % (page_url, quote(sprint_name)))
# see if milestone is set correctly
tc.find('<option selected="selected">\s*milestone2')
# test setting end date, not duration
tc.formvalue('modcomp', 'description', '[http://www.example.com]')
tomorrow = sprint_start + timedelta(days=1)
tc.formvalue('modcomp', 'end', format_datetime(tomorrow, format='iso8601'))
tc.formvalue('modcomp', 'duration', '')
tc.submit('save')
tc.url(page_url)
# duration of the new sprint should be 2
tc.find('"duration">2</td>')
# --- test invalid values when adding sprint ---
# no values, should redirect to list view
tc.formvalue('addsprint', 'name', '')
tc.submit('add')
tc.url(page_url)
# invalid date, should throw an error
tc.formvalue('addsprint', 'name', 'Testsprint 2')
tc.formvalue('addsprint', 'start', '2008 May 13')
tc.formvalue('addsprint', 'duration', '1')
tc.submit('add')
tc.find('Error: Invalid Date')
# no end date or duration
tc.go(page_url)
tc.formvalue('addsprint', 'name', 'Testsprint 2')
yesterday = now() - timedelta(days=3)
tc.formvalue('addsprint', 'start',
format_datetime(yesterday, format='iso8601'))
tc.submit('add')
tc.url(page_url)
示例9: runTest
def runTest(self):
# First login as team member, there should be no Requirement but the task
self._tester.login_as(Usernames.team_member)
tc.go('/newticket?type=task')
tc.url(r'(.+)(/newticket\?type=task)')
error_msg = 'Requirement should not be allowed for team members!'
self.assertNotFindItem('field-type', 'Requirement', error_msg)
tc.fv('propertyform', 'field-type', 'Task')
# Now login as PO and the Requirement should be there, but the task not
self._tester.login_as(Usernames.product_owner)
tc.go('/newticket?type=requirement')
tc.url(r'(.+)(/newticket\?type=requirement)')
error_msg = 'Task should not be allowed for product owner!'
self.assertNotFindItem('field-type', 'Task', error_msg)
tc.fv('propertyform', 'field-type', 'Requirement')
示例10: _close_sprint
def _close_sprint(name, retarget=None):
page_url = '%s/%s' % (SPRINT_URL, name)
confirm_url = '%s/%s/confirm' % (SPRINT_URL, name)
tc.go(page_url)
tc.fv('confirmform', 'close', 'click')
tc.submit()
# show confirmation form
tc.url(confirm_url)
if retarget is not None:
# should show that one ticket can be retargeted
tc.find('Retarget the \d+ remaining tickets to sprint')
tc.fv('confirmform', 'retarget', retarget)
tc.fv('confirmform', 'sure', 'click')
tc.submit('sure')
# we're back at the roadmap
tc.url('/roadmap')
示例11: _delete_sprint
def _delete_sprint(name, retarget=None, tickets=0):
page_url = '%s/%s' % (SPRINT_URL, name)
confirm_url = '%s/%s/confirm' % (SPRINT_URL, name)
tc.go(page_url)
tc.fv('confirmform', 'delete', 'click')
tc.submit()
# show confirmation form
tc.url(confirm_url)
if retarget is not None:
# should show that some tickets can be re-targeted
tc.find('Retarget the %s remaining tickets to sprint' % tickets)
tc.fv('confirmform', 'retarget', retarget)
tc.fv('confirmform', 'sure', 'click')
tc.submit('sure')
# we're back at the roadmap
tc.code(200)
tc.url('/roadmap')
示例12: runTest
def runTest(self):
"""Render reStructured text using a wikiprocessor"""
pagename = self._tester.create_wiki_page(content="""
{{{
#!rst
Hello
=====
.. trac:: wiki:WikiStart Some Link
}}}
""")
self._tester.go_to_wiki(pagename)
tc.find("Some Link")
tc.find(r'<h1[^>]*>Hello')
tc.notfind("wiki:WikiStart")
tc.follow("Some Link")
tc.url(self._tester.url + "/wiki/WikiStart")