本文整理汇总了Python中trac.tests.functional.tc.submit函数的典型用法代码示例。如果您正苦于以下问题:Python submit函数的具体用法?Python submit怎么用?Python submit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了submit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runTest
def runTest(self):
"""Admin modify priority details"""
name = "DetailPriority"
# Create a priority
self._tester.create_priority(name + '1')
# Modify the details of the priority
priority_url = self._tester.url + "/admin/ticket/priority"
tc.go(priority_url)
tc.url(priority_url + '$')
tc.follow(name + '1')
tc.url(priority_url + '/' + name + '1')
tc.formvalue('edit', 'name', name + '2')
tc.submit('save')
tc.url(priority_url + '$')
# Cancel more modifications
tc.go(priority_url)
tc.follow(name)
tc.formvalue('edit', 'name', name + '3')
tc.submit('cancel')
tc.url(priority_url + '$')
# Verify that only the correct modifications show up
tc.notfind(name + '1')
tc.find(name + '2')
tc.notfind(name + '3')
示例2: runTest
def runTest(self):
self.tester.login_as(Usernames.product_owner)
requirement_id = self.tester.create_new_agilo_requirement('My Requirement')
self.tester.go_to_view_ticket_page(requirement_id)
self.tester.select_form_for_twill('attachfile', 'attachfilebutton')
tc.submit('attachfile')
tc.find('Add Attachment to')
示例3: 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')
示例4: runTest
def runTest(self):
"""Test for regression of http://trac.edgewall.org/ticket/11515
Show a notice message with new language setting after it is changed.
"""
from trac.util.translation import has_babel, get_available_locales
from pkg_resources import resource_exists, resource_filename
if not has_babel:
return
if not resource_exists("trac", "locale"):
return
locale_dir = resource_filename("trac", "locale")
from babel.support import Translations
string = "Your preferences have been saved."
translated = None
for second_locale in get_available_locales():
tx = Translations.load(locale_dir, second_locale)
translated = tx.dgettext("messages", string)
if string != translated:
break # the locale has a translation
else:
return
try:
self._tester.go_to_preferences("Language")
tc.formvalue("userprefs", "language", second_locale)
tc.submit()
tc.find(re.escape(translated))
finally:
tc.formvalue("userprefs", "language", "") # revert to default
tc.submit()
tc.find("Your preferences have been saved")
示例5: runTest
def runTest(self):
self._tester.login_as(Usernames.admin)
page_url = self._tester.url + '/admin/agilo/fields'
tc.go(page_url)
tc.formvalue('addcf', 'name', 'ä')
tc.submit('add')
assert 'Only alphanumeric characters allowed for custom field' in tc.show()
示例6: runTest
def runTest(self):
"""Set preferences for syntax highlighting."""
self._tester.go_to_preferences("Syntax Highlighting")
tc.find('<option value="trac" selected="selected">')
tc.formvalue('userprefs', 'style', 'Emacs')
tc.submit()
tc.find('<option value="emacs" selected="selected">')
示例7: 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)
示例8: runTest
def runTest(self):
"""Set default handler from the Basic Settings page."""
# Confirm default value.
self._tester.go_to_admin("Basic Settings")
tc.find(r'<option selected="selected" value="WikiModule">'
r'WikiModule</option>')
tc.go(self._tester.url)
tc.find("Welcome to Trac")
# Set to another valid default handler.
self._tester.go_to_admin("Basic Settings")
tc.formvalue('modbasic', 'default_handler', 'TimelineModule')
tc.submit()
tc.find("Your changes have been saved.")
tc.find(r'<option selected="selected" value="TimelineModule">'
r'TimelineModule</option>')
tc.go(self._tester.url)
tc.find(r'<h1>Timeline</h1>')
# Set to valid disabled default handler.
try:
self._testenv.set_config('components',
'trac.timeline.web_ui.TimelineModule',
'disabled')
self._tester.go_to_admin("Basic Settings")
tc.find(r'<option value="TimelineModule">TimelineModule</option>')
tc.find(r'<span class="hint">TimelineModule is not a valid '
r'IRequestHandler or is not enabled.</span>')
tc.go(self._tester.url)
tc.find(r'<h1>Configuration Error</h1>')
tc.find(r'Cannot find an implementation of the '
r'<code>IRequestHandler</code> interface named '
r'<code>TimelineModule</code>')
finally:
self._testenv.remove_config('components',
'trac.timeline.web_ui.timelinemodule')
# Set to invalid default handler.
try:
self._testenv.set_config('trac', 'default_handler',
'BatchModifyModule')
self._tester.go_to_admin("Basic Settings")
tc.find(r'<option value="BatchModifyModule">BatchModifyModule'
r'</option>')
tc.find(r'<span class="hint">BatchModifyModule is not a valid '
r'IRequestHandler or is not enabled.</span>')
tc.formvalue('modbasic', 'default_handler', 'BatchModifyModule')
tc.submit() # Invalid value should not be replaced on submit
tc.find(r'<option value="BatchModifyModule">BatchModifyModule'
r'</option>')
tc.find(r'<span class="hint">BatchModifyModule is not a valid '
r'IRequestHandler or is not enabled.</span>')
tc.go(self._tester.url)
tc.find(r'<h1>Configuration Error</h1>')
tc.find(r'<code>BatchModifyModule</code> is not a valid default '
r'handler.')
finally:
self._testenv.set_config('trac', 'default_handler', 'WikiModule')
示例9: _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)
示例10: runTest
def runTest(self):
self._tester.login_as(Usernames.product_owner)
ticket_id = self._tester.create_new_agilo_ticket(Type.REQUIREMENT, 'req')
self._tester.go_to_view_ticket_page(ticket_id)
new_summary = 'really interesting'
tc.formvalue('propertyform', 'field_summary', new_summary)
tc.submit('submit')
tc.find(new_summary)
示例11: 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)
示例12: runTest
def runTest(self):
"""Repository with an invalid path is rendered with an error
message on the repository admin page.
"""
self._tester.go_to_admin("Repositories")
tc.formvalue("trac-addrepos", "name", "InvalidRepos")
tc.formvalue("trac-addrepos", "dir", "/the/invalid/path")
tc.submit()
tc.find((u'<span class="missing" title="[^"]*">' u"/the/\u200binvalid/\u200bpath</span>").encode("utf-8"))
示例13: _test_ajax_update_fields
def _test_ajax_update_fields(self):
# test Ajax functionality by clicking "update fields" or
# passing the new values as a GET parameter
tc.fv('modcomp', 'scope', 'milestone')
tc.submit('preview')
# see if the available and selected fields for this backlog
# type are display correctly
tc.find('<option selected="selected" [^>]*>milestone</option>')
示例14: runTest
def runTest(self):
"""Repository with an invalid path is rendered with an error
message on the repository admin page.
"""
self._tester.go_to_admin("Repositories")
tc.formvalue('trac-addrepos', 'name', 'InvalidRepos')
tc.formvalue('trac-addrepos', 'dir', '/the/invalid/path')
tc.submit()
tc.find((u'<span class="missing" title="[^"]*">'
u'/the/\u200binvalid/\u200bpath</span>').encode('utf-8'))
示例15: runTest
def runTest(self):
self._tester.login_as(Usernames.product_owner)
self._tester.upload_csv_for_import(GOOD_CSV_DATA, 'UTF-8')
tc.find('<h1>Import Preview</h1>')
# Select one form for twill
tc.formvalue('cancel_import', 'cancel', '1')
tc.submit('Cancel')
tc.notfind('<strong>Warning:</strong>')
tc.find('<h1>Import New Tickets from CSV</h1>')