• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tc.formvalue函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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")
开发者ID:exocad,项目名称:exotrac,代码行数:33,代码来源:functional.py


示例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')
开发者ID:pkdevbox,项目名称:trac,代码行数:27,代码来源:admin.py


示例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')
开发者ID:djangsters,项目名称:agilo,代码行数:7,代码来源:ticket_gui_test.py


示例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)
开发者ID:djangsters,项目名称:agilo,代码行数:26,代码来源:team_test.py


示例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()
开发者ID:djangsters,项目名称:agilo,代码行数:7,代码来源:custom_field_admin_test.py


示例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.')
开发者ID:pkdevbox,项目名称:trac,代码行数:25,代码来源:functional.py


示例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">')
开发者ID:pkdevbox,项目名称:trac,代码行数:7,代码来源:functional.py


示例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')
开发者ID:pkdevbox,项目名称:trac,代码行数:59,代码来源:functional.py


示例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)
开发者ID:djangsters,项目名称:agilo,代码行数:8,代码来源:ticket_permission_test.py


示例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"))
开发者ID:pkdevbox,项目名称:trac,代码行数:9,代码来源:functional.py


示例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'))
开发者ID:exocad,项目名称:exotrac,代码行数:10,代码来源:functional.py


示例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>')
开发者ID:djangsters,项目名称:agilo,代码行数:11,代码来源:import_test.py


示例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)
开发者ID:djangsters,项目名称:agilo,代码行数:11,代码来源:rename_milestone_test.py


示例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')
开发者ID:djangsters,项目名称:agilo,代码行数:12,代码来源:link_permission_test.py


示例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)
开发者ID:djangsters,项目名称:agilo,代码行数:13,代码来源:link_deletion_test.py



注:本文中的trac.tests.functional.tc.formvalue函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tc.go函数代码示例发布时间:2022-05-27
下一篇:
Python tc.find函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap