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

Python commands.follow函数代码示例

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

本文整理汇总了Python中twill.commands.follow函数的典型用法代码示例。如果您正苦于以下问题:Python follow函数的具体用法?Python follow怎么用?Python follow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了follow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_project_actions

    def test_project_actions(self):
        
        # main page
        tc.go( testlib.PROJECT_LIST_URL )
        tc.find("Logged in as") 

        # default project list
        tc.find("Fly data 19") 
        tc.find("Human HELA 16") 
        tc.find("Mouse project HBB 1") 


        # create a new project
        name = "Rainbow Connection - New Project"
        self.create_project(name=name)

        # visit this new project
        tc.follow(name)
        tc.code(200)
        tc.find("Project: %s" % name)

        # edit and rename project
        newname = "Iguana Garden - New Project"
        tc.follow("Edit")
        tc.find("Edit Project")
        tc.fv("1", "name", newname )
        tc.fv("1", "info", "Some other *markup* goes here")
        tc.submit()
        tc.code(200)
        tc.notfind(name)
        tc.find(newname)

        self.delete_project(name=newname)
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:33,代码来源:functional.py


示例2: test_confirm_password_reset

 def test_confirm_password_reset(self):
     """
     create confirmation link as Django engine and
     test it for resetting password
     """
     test_email = '[email protected]'
     go(SITE)
     code(200)
     follow('reset password')
     code(200)
     fv(2, 'email', test_email)
     submit()
     code(200)
     #create links
     from django.contrib.auth.tokens import default_token_generator
     from django.utils.http import int_to_base36
     users = User.objects.filter(email__iexact=test_email)
     for user in users:
         link = "%s/accounts/password/reset_confirm/%s/%s/" % (SITE,
                 int_to_base36(user.id),
                 default_token_generator.make_token(user))
         go(link)
         code(200)
         find('Password reset confirm')
         fv(2, 'new_password1', 'test')
         fv(2, 'new_password2', 'test')
         submit()
         code(200)
         find('Your password was successfully reseted')
         self.general_login_action(user.username,
                                 'test',
                                 "Welcome, %s" % user.username)
开发者ID:xaratt,项目名称:andrytest,代码行数:32,代码来源:test.py


示例3: test_image_processing_library_error

    def test_image_processing_library_error(self):
        """
        If the image processing library errors while preparing a photo, report a
        helpful message to the user and log the error. The photo is not added
        to the user's profile.
        """
        # Get a copy of the error log.
        string_log = StringIO.StringIO()
        logger = logging.getLogger()
        my_log = logging.StreamHandler(string_log)
        logger.addHandler(my_log)
        logger.setLevel(logging.ERROR)

        self.login_with_twill()
        tc.go(make_twill_url('http://openhatch.org/people/paulproteus/'))
        tc.follow('photo')
        # This is a special image from issue166 that passes Django's image
        # validation tests but causes an exception during zlib decompression.
        tc.formfile('edit_photo', 'photo', photo('static/images/corrupted.png'))
        tc.submit()
        tc.code(200)

        self.assert_("Something went wrong while preparing this" in tc.show())
        p = Person.objects.get(user__username='paulproteus')
        self.assertFalse(p.photo.name)

        # an error message was logged during photo processing.
        self.assert_("zlib.error" in string_log.getvalue())
        logger.removeHandler(my_log)
开发者ID:boblannon,项目名称:oh-mainline,代码行数:29,代码来源:tests.py


示例4: send

    def send(self, msg, *send_to):
        """
        @todo: make use of native vodafone multi-recipients functionality
        """
        for contact in send_to:
            web.follow(self.SERVICE_URL)

            try:
                web.find("/myv/messaging/webtext/Challenge.shtml")
            except twill.errors.TwillAssertionError, e:
                pass
            else:
                web.go("/myv/messaging/webtext/Challenge.shtml")
                with tempfile.NamedTemporaryFile(suffix=".jpeg") as captcha:
                    web.save_html(captcha.name)
                    web.back()
                    os.system("open %s " % captcha.name)
                    web.formvalue("WebText", "jcaptcha_response", raw_input("Captcha: "))

            web.formvalue("WebText", "message", msg)
            to = getattr(contact, "mobile", contact)
            web.formvalue("WebText", "recipient_0", to)

            web.sleep(2)
            web.submit()
            web.code(200)
            web.find("Message sent!")
开发者ID:lukmdo,项目名称:smsgates,代码行数:27,代码来源:contrib.py


示例5: test_logout_web

 def test_logout_web(self):
     self.test_login_web()
     url = 'http://openhatch.org/search/'
     url = make_twill_url(url)
     tc.go(url)
     tc.notfind('log in')
     tc.follow('log out')
     tc.find('log in')
开发者ID:boblannon,项目名称:oh-mainline,代码行数:8,代码来源:tests.py


示例6: test_project_stress

 def test_project_stress(self):
     names = [ 'STRESS-NAME-%010d' % step for step in range(11) ]
     for name in names:
         self.create_project(name)
     
     for name in names:
         tc.go( testlib.PROJECT_LIST_URL )
         tc.follow(name)
         self.delete_project(name)
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:9,代码来源:functional.py


示例7: test_create_confirmation_link

 def test_create_confirmation_link(self):
     """ filling and submitting form on create confirmation link page """
     go(SITE)
     code(200)
     follow("reset password")
     code(200)
     fv(2, 'email', '[email protected]')
     submit()
     code(200)
     find('Please, check your e-mail')
开发者ID:xaratt,项目名称:andrytest,代码行数:10,代码来源:test.py


示例8: test_login_success_no_profile

 def test_login_success_no_profile(self):
     """ successfull login for user without profile """
     user1 = User.objects.get(username__exact='user1')
     user1.get_profile().delete()
     self.general_login_action('user1',
                               'password1',
                               'Welcome, user1')
     follow('profile')
     code(200)
     find('Profile for this user not exists')
开发者ID:xaratt,项目名称:andrytest,代码行数:10,代码来源:test_djangoregistration.py


示例9: push_item

def push_item(projectname, summary, comment, status, label):
    go("http://code.google.com/p/%s/issues/list" % (projectname,))
    follow("New Issue")
    fv("3", "summary", summary)
    fv("3", "comment", wraptext(comment))
    fv("3", "status", status)
    fv("3", "labelenter0", label)
    fv("3", "labelenter1", "")

    submit("submit")
    notfind("Letters did not match")
开发者ID:Opngate,项目名称:moinmoin,代码行数:11,代码来源:googlepush.py


示例10: delete_project

 def delete_project(self, name):
     """
     Deletes a project
     """
     tc.follow("Delete")
     tc.find("You are removing")
     tc.fv("1", "delete", True)
     tc.submit()
     tc.code(200)
     tc.find("Project deletion complete")
     tc.notfind(name)
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:11,代码来源:functional.py


示例11: sendNetcom

def sendNetcom(opts, msg):
    tc.go("https://www.netcom.no")
    tc.follow("» Logg inn på Min side")
    tc.fv('2', 'username', opts["netcom_user"])
    tc.fv('2', 'password', opts["netcom_pass"])
    tc.submit()
    tc.follow("Send 25 gratis SMS")
    tc.fv('2', 'gsmnumber', opts["netcom_user"])
    tc.submit('submitChooseContact')
    tc.fv('2', 'message', msg)
    tc.submit('submitSendsms')
开发者ID:tobiasvl,项目名称:studweb,代码行数:11,代码来源:studweb.py


示例12: push_item

def push_item(projectname, summary, comment, status, label):
    go('http://code.google.com/p/%s/issues/list' % (projectname, ))
    follow('New Issue')
    fv('3', 'summary', summary)
    fv('3', 'comment', wraptext(comment))
    fv('3', 'status', status)
    fv("3", "labelenter0", label)
    fv("3", "labelenter1", "")

    submit('submit')
    notfind("Letters did not match")
开发者ID:steveyen,项目名称:moingo,代码行数:11,代码来源:googlepush.py


示例13: test_reg_passwords_not_equal

 def test_reg_passwords_not_equal(self):
     """ failed registration with entering not equal passwords """
     go(SITE)
     code(200)
     follow('registration')
     code(200)
     fv(2, 'username', 'user3')
     fv(2, 'password1', 'password3')
     fv(2, 'password2', 'password')
     submit()
     code(200)
     find("The two password fields didn't match")
开发者ID:xaratt,项目名称:andrytest,代码行数:12,代码来源:test.py


示例14: test1

 def test1(self):
     url = "http://www.yourwebsite.com/signup/"
     twill_quiet()
     tc.go('ubuntu')
     tc.find('Registro Brasileiro')
     tc.follow('register')
     tc.url()
     # Fill in the form
     tc.fv('1', 'username', 'test123')
     tc.fv('1', 'email', '[email protected]')
     tc.submit()
     tc.find('click the activation link')
开发者ID:ensaiosclinicos,项目名称:clinicaltrials,代码行数:12,代码来源:test_register.py


示例15: test_reg_user_exists

 def test_reg_user_exists(self):
     """ failed registration with existing username """
     go(SITE)
     code(200)
     follow('registration')
     code(200)
     fv(2, 'username', 'user1')
     fv(2, 'password1', 'password3')
     fv(2, 'password2', 'password3')
     submit()
     code(200)
     find('A user with that username already exists')
开发者ID:xaratt,项目名称:andrytest,代码行数:12,代码来源:test.py


示例16: test_set_avatar

 def test_set_avatar(self):
     self.login_with_twill()
     for image in (photo('static/sample-photo.png'),
                   photo('static/sample-photo.jpg')):
         url = 'http://openhatch.org/people/paulproteus/'
         tc.go(make_twill_url(url))
         tc.follow('photo')
         tc.formfile('edit_photo', 'photo', image)
         tc.submit()
         # Now check that the photo == what we uploaded
         p = Person.objects.get(user__username='paulproteus')
         self.assert_(p.photo.read() ==
                 open(image).read())
开发者ID:boblannon,项目名称:oh-mainline,代码行数:13,代码来源:tests.py


示例17: login

 def login(self, name='admin', passwd='1'):
     "Performs a login"
     tc.go( testlib.BASE_URL )
     tc.follow('Log in now')
     tc.find("Please log in") 
     tc.code(200)
     
     # logs in on every test
     tc.fv("1", "email", name)
     tc.fv("1", "password", passwd)
     tc.submit('0')
     tc.code(200)
     tc.find("Logged in as") 
开发者ID:JCVI-Cloud,项目名称:galaxy-tools-prok,代码行数:13,代码来源:functional.py


示例18: test_reg_success

 def test_reg_success(self):
     """ successfull registration """
     go(SITE)
     code(200)
     follow('registration')
     code(200)
     fv(2, 'username', 'user3')
     fv(2, 'password1', 'password3')
     fv(2, 'password2', 'password3')
     submit()
     code(200)
     find('New account successfully created')
     self.general_login_action('user3', 'password3', 'Welcome, user3')
开发者ID:xaratt,项目名称:andrytest,代码行数:13,代码来源:test.py


示例19: test_set_avatar_too_wide

 def test_set_avatar_too_wide(self):
     self.login_with_twill()
     for image in [photo('static/images/too-wide.jpg'),
                   photo('static/images/too-wide.png')]:
         url = 'http://openhatch.org/people/paulproteus/'
         tc.go(make_twill_url(url))
         tc.follow('photo')
         tc.formfile('edit_photo', 'photo', image)
         tc.submit()
         # Now check that the photo is 200px wide
         p = Person.objects.get(user__username='paulproteus')
         image_as_stored = Image.open(p.photo.file)
         w, h = image_as_stored.size
         self.assertEqual(w, 200)
开发者ID:aishahalim,项目名称:OpenHatch,代码行数:14,代码来源:tests.py


示例20: general_login_action

 def general_login_action(self, username, password, message):
     """
     login with given username/password and find given message on page
     """
     clear_extra_headers()
     go(SITE)
     code(200)
     follow('common login')
     code(200)
     fv(1, 'username', username)
     fv(1, 'password', password)
     submit()
     code(200)
     find(message)
开发者ID:xaratt,项目名称:andrytest,代码行数:14,代码来源:test_djangoregistration.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python commands.formfile函数代码示例发布时间:2022-05-27
下一篇:
Python commands.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