本文整理汇总了Python中trac.tests.functional.tc.formvalue函数的典型用法代码示例。如果您正苦于以下问题:Python formvalue函数的具体用法?Python formvalue怎么用?Python formvalue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formvalue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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")
示例2: 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')
示例3: runTest
def runTest(self):
self._tester.login_as(Usernames.team_member)
self._tester.go_to_new_ticket_page(Type.TASK)
tc.formvalue('propertyform', 'summary', 'Foo Summary')
tc.submit('preview')
tc.notfind('Business Value Points')
tc.notfind('User Story Priority')
示例4: 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)
示例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 admin user"""
self._tester.go_to_preferences()
try:
tc.notfind('Your preferences have been saved.')
tc.formvalue('userprefs', 'name', ' System Administrator ')
tc.formvalue('userprefs', 'email', ' [email protected] ')
tc.submit()
tc.find('Your preferences have been saved.')
self._tester.go_to_preferences("Localization")
tc.formvalue('userprefs', 'tz', 'GMT -10:00')
tc.submit()
tc.find('Your preferences have been saved.')
self._tester.go_to_preferences()
tc.notfind('Your preferences have been saved.')
tc.find('value="System Administrator"')
tc.find(r'value="[email protected]\.com"')
self._tester.go_to_preferences("Localization")
tc.find('GMT -10:00')
finally:
self._tester.go_to_preferences()
tc.formvalue('userprefs', 'name', '')
tc.formvalue('userprefs', 'email', '')
tc.submit()
tc.find('Your preferences have been saved.')
示例7: 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">')
示例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: 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)
示例10: 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"))
示例11: 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'))
示例12: 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>')
示例13: runTest
def runTest(self):
tc.go(self.tester.url + '/admin/ticket/milestones/' + unicode_quote(self.milestone_name()))
new_name = self.milestone_name() + 'Renamed'
tc.formvalue('modifymilestone', 'name', new_name)
tc.submit('save')
tc.code(200)
# Now we expect that the ticket and the sprint have updated milestone
ticket_page = self.tester.navigate_to_ticket_page(self.tkt_id)
self.assert_equals(new_name, ticket_page.milestone())
self.tester.go_to_sprint_edit_page("SprintFor" + self.milestone_name())
tc.find('for milestone %s</h1>' % new_name)
示例14: runTest
def runTest(self):
self._tester.login_as(Usernames.product_owner)
story_id = self._tester.create_new_agilo_userstory('as a product owner...')
self._tester.assign_ticket_to(story_id, Usernames.team_member)
self._tester.login_as(Usernames.team_member)
self._tester.create_referenced_ticket(story_id, Type.TASK, 'we should do that.')
self._tester.login_as(Usernames.product_owner)
self._tester.go_to_view_ticket_page(story_id)
tc.formvalue('delete_link', 'cmd', 'submit')
tc.submit('cmd')
示例15: runTest
def runTest(self):
# First login, anonymous may not be allowed to do anything
self._tester.login_as(Usernames.admin)
bug_id = self._tester.create_new_agilo_ticket('bug', 'Nothing happens')
task_id = self._tester.create_referenced_ticket(bug_id, Type.TASK, 'Think about fixing it')
self._tester.go_to_view_ticket_page(bug_id)
tc.find('value="delete link"')
tc.formvalue('delete_link', 'cmd', 'delete') # select the correct form
tc.submit('cmd')
tc.code(200)
self.assertTrue(self._tester.browser_shows_ticket_edit_page(bug_id))
self._assert_task_is_not_linked_to_bug(task_id, bug_id)