示例#1
0
 def test_splinter_sponsor_issue_HHH_1052(self):
     add_initial_projects()
     offer = td.buildOfferForHHH1052(self.users[0].adminUser)
     td.loadOffer(offer)
     try:
         self.app.login_plain(td.userDict2)
         self.app.followIssueLinkOnHomeByTitle(
             'Allow CalendarType.set to accept Date objects')
         otherOffer = {
             'price': Decimal('15.00'),
             'acceptanceCriteria': 'Soh comitar',
             'require_release': False,
             'no_forking': True,
         }
         self.app.sponsorCurrentIssue(otherOffer)
         assert (self.app.is_text_present(
             '[ Offer ] US$ 15.00 for issue - Allow CalendarType.set to accept Date objects'
         ))
         self.app.followIssueLinkOnHomeByTitle(
             'Allow CalendarType.set to accept Date objects')
         self.app.followOfferLinkByValue(otherOffer['price'])
     except:
         traceback.print_exc()
         sleep(waitifbreak)
         raise
示例#2
0
    def test_splinter_edit_issue_HHH_1052(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        self.app.login_plain(td.userDict1)
        try:
            self.app.followIssueLinkOnHomeByTitle(
                'Allow CalendarType.set to accept Date objects')

            self.app.editCurrentOffer(price=Decimal('11.00'),
                                      expires=True,
                                      expiration_days=2)
            assert (self.app.is_text_present(
                '[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'
            ))
            assert (self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(expires=False)
            assert (self.app.is_text_present(
                '[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'
            ))
            assert (not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(no_forking=True, require_release=False)
            assert (self.app.is_text_present(
                '[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'
            ))
            assert (self.app.is_text_present('NO FORKING'))
            assert (not self.app.is_text_present('RELEASE REQUIRED'))
            assert (not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(no_forking=False, require_release=True)
            assert (self.app.is_text_present(
                '[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'
            ))
            assert (not self.app.is_text_present('NO FORKING'))
            assert (self.app.is_text_present('RELEASE REQUIRED'))
            assert (not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(price=Decimal('100'),
                                      expires=True,
                                      expiration_days=200)
            assert (self.app.is_text_present(
                '[ Offer ] US$ 100.00 for issue - Allow CalendarType.set to accept Date objects'
            ))
            assert (not self.app.is_text_present('NO FORKING'))
            assert (self.app.is_text_present('RELEASE REQUIRED'))
            assert (self.app.is_text_present('EXPIRES ON '))

        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise
    def test_splinter_solo_comments(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        self.app.login_plain(td.userDict1)
        try:
            self.app.followSponsoringIssueLinkOnHomeByTitle(
                'Allow CalendarType.set to accept Date objects')

            def gogogo():
                self.app.commentOnCurrentIssueOrOffer('Hello comment')
                assert (self.app.is_text_present('Hello comment'))
                comment = '''
I am another comment

    def pyfunc():
        print 'blag'

another text

    <script>alert('hi')</script>
                '''
                self.app.commentOnCurrentIssueOrOffer(comment,
                                                      'I am another comment')
                assert (self.app.is_text_present('Hello comment'))
                assert (self.app.is_text_present('I am another comment'))
                assert (self.app.is_text_present('def pyfunc():'))
                assert (
                    self.app.is_text_present("<script>alert('hi')</script>"))
                self.app.editCommentOnCurrentIssueOrOffer(0, 'Howdy comment')
                assert (not self.app.is_text_present('Hello comment'))
                assert (self.app.is_text_present('Howdy comment'))
                self.app.editCommentOnCurrentIssueOrOffer(1, 'bilubilu')
                assert (not self.app.is_text_present('I am another comment'))
                assert (not self.app.is_text_present(
                    "<script>alert('hi')</script>"))
                assert (self.app.is_text_present('bilubilu'))

            gogogo()
            self.app.followOfferLinkByValue(Decimal('10.00'))
            gogogo()
        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise
    def test_pay_with_paypal(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        solution = td.buildSolutionDoneFor(offer.issue, self.users[1].adminUser, True)
        td.loadSolution(solution)
        try:
            self.app.login_plain(td.userDict1)
            self.app.followSponsoringIssueLinkOnHomeByTitle('Allow CalendarType.set to accept Date objects')
            self.app.pay_with_paypal(td.paypal_credentials_1)
            self.app.followSponsoringIssueLinkOnHomeByTitle('Allow CalendarType.set to accept Date objects')
            sleep(10)
#            assert(self.app.is_text_present('10.00'))
#            assert(self.app.is_text_present('PAID'))
        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise
    def test_splinter_solo_comments(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        self.app.login_plain(td.userDict1)
        try:
            self.app.followIssueLinkOnHomeByTitle("Allow CalendarType.set to accept Date objects")

            def gogogo():
                self.app.commentOnCurrentIssueOrOffer("Hello comment")
                assert self.app.is_text_present("Hello comment")
                comment = """
I am another comment

    def pyfunc():
        print 'blag'

another text

    <script>alert('hi')</script>
                """
                self.app.commentOnCurrentIssueOrOffer(comment, "I am another comment")
                assert self.app.is_text_present("Hello comment")
                assert self.app.is_text_present("I am another comment")
                assert self.app.is_text_present("def pyfunc():")
                assert self.app.is_text_present("<script>alert('hi')</script>")
                self.app.editCommentOnCurrentIssueOrOffer(0, "Howdy comment")
                assert not self.app.is_text_present("Hello comment")
                assert self.app.is_text_present("Howdy comment")
                self.app.editCommentOnCurrentIssueOrOffer(1, "bilubilu")
                assert not self.app.is_text_present("I am another comment")
                assert not self.app.is_text_present("<script>alert('hi')</script>")
                assert self.app.is_text_present("bilubilu")

            gogogo()
            self.app.followOfferLinkByValue(Decimal("10.00"))
            gogogo()
        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise
 def test_splinter_sponsor_issue_HHH_1052(self):
     add_initial_projects()
     offer = td.buildOfferForHHH1052(self.users[0].adminUser)
     td.loadOffer(offer)
     try:
         self.app.login_plain(td.userDict2)
         self.app.followIssueLinkOnHomeByTitle('Allow CalendarType.set to accept Date objects')
         otherOffer = {
             'price':Decimal('15.00'),
             'acceptanceCriteria':'Soh comitar',
             'require_release' : False,
             'no_forking' : True,
         }
         self.app.sponsorCurrentIssue(otherOffer)
         assert(self.app.is_text_present('[ Offer ] US$ 15.00 for issue - Allow CalendarType.set to accept Date objects'))
         self.app.followIssueLinkOnHomeByTitle('Allow CalendarType.set to accept Date objects')
         self.app.followOfferLinkByValue(otherOffer['price'])
     except:
         traceback.print_exc()
         sleep(waitifbreak)
         raise
    def test_pay_with_paypal(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        solution = td.buildSolutionDoneFor(offer.issue,
                                           self.users[1].adminUser, True)
        td.loadSolution(solution)
        try:
            self.app.login_plain(td.userDict1)
            self.app.followSponsoringIssueLinkOnHomeByTitle(
                'Allow CalendarType.set to accept Date objects')
            self.app.pay_with_paypal(td.paypal_credentials_1)
            self.app.followSponsoringIssueLinkOnHomeByTitle(
                'Allow CalendarType.set to accept Date objects')
            sleep(10)
#            assert(self.app.is_text_present('10.00'))
#            assert(self.app.is_text_present('PAID'))
        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise
    def test_splinter_edit_issue_HHH_1052(self):
        add_initial_projects()
        offer = td.buildOfferForHHH1052(self.users[0].adminUser)
        td.loadOffer(offer)
        self.app.login_plain(td.userDict1)
        try:
            self.app.followIssueLinkOnHomeByTitle('Allow CalendarType.set to accept Date objects')

            self.app.editCurrentOffer(price=Decimal('11.00'), expires=True, expiration_days=2)
            assert(self.app.is_text_present('[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'))
            assert(self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(expires=False)
            assert(self.app.is_text_present('[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'))
            assert(not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(no_forking=True, require_release=False)
            assert(self.app.is_text_present('[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'))
            assert(self.app.is_text_present('NO FORKING'))
            assert(not self.app.is_text_present('RELEASE REQUIRED'))
            assert(not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(no_forking=False, require_release=True)
            assert(self.app.is_text_present('[ Offer ] US$ 11.00 for issue - Allow CalendarType.set to accept Date objects'))
            assert(not self.app.is_text_present('NO FORKING'))
            assert(self.app.is_text_present('RELEASE REQUIRED'))
            assert(not self.app.is_text_present('EXPIRES ON '))

            self.app.editCurrentOffer(price=Decimal('100'), expires=True, expiration_days=200)
            assert(self.app.is_text_present('[ Offer ] US$ 100.00 for issue - Allow CalendarType.set to accept Date objects'))
            assert(not self.app.is_text_present('NO FORKING'))
            assert(self.app.is_text_present('RELEASE REQUIRED'))
            assert(self.app.is_text_present('EXPIRES ON '))

        except:
            traceback.print_exc()
            sleep(waitifbreak)
            raise