def test_that_a_response_can_be_replied_to_an_ureporter(self):
        message = "Hello"
        PollBase.start_poll(self.browser,self.poll_id)
        number_of_responses = PollBase.respond_to_the_started_poll("0794339344", "yes")
        self.assert_that_number_of_responses_increase_by(number_of_responses, 1)

        PollBase.reply_poll_to_an_ureporter(self.poll_id, message)
        self.assert_that_message_has_been_sent_out_to_ureporter(message)
    def test_that_poll_responses_are_shown_up_at_report_page(self):
        PollBase.start_poll(self.browser,self.poll_id)

        PollBase.respond_to_the_started_poll("0794339344", "yes")
        SplinterWrapper.open('/polls/%s/report/' % self.poll_id)
        self.assert_that_question_is(self.question)
        self.assert_the_number_of_participants_of_the_poll_is(1)

        self.assert_that_response_location_is("Kasese")
        self.assert_that_number_of_responses_is(1)
    def test_that_a_response_can_be_replied_to_an_ureporter(self):
        message = "Hello"
        PollBase.start_poll(self.browser, self.poll_id)
        number_of_responses = PollBase.respond_to_the_started_poll(
            "0794339344", "yes")
        self.assert_that_number_of_responses_increase_by(
            number_of_responses, 1)

        PollBase.reply_poll_to_an_ureporter(self.poll_id, message)
        self.assert_that_message_has_been_sent_out_to_ureporter(message)
    def test_that_poll_responses_are_shown_up_at_report_page(self):
        PollBase.start_poll(self.browser, self.poll_id)

        PollBase.respond_to_the_started_poll("0794339344", "yes")
        SplinterWrapper.open('/polls/%s/report/' % self.poll_id)
        self.assert_that_question_is(self.question)
        self.assert_the_number_of_participants_of_the_poll_is(1)

        self.assert_that_response_location_is("Kasese")
        self.assert_that_number_of_responses_is(1)
    def test_that_a_poll_response_can_be_reassigned_to_another_poll(self):
        second_poll_id = PollBase.create_poll(self.browser,name='Second Poll',type="Yes/No Question",question="Is the first poll working?",group="groupFT")
        PollBase.start_poll(self.browser,second_poll_id)

        PollBase.respond_to_the_started_poll("0794339344", "yes")
        PollBase.close_poll(second_poll_id)

        PollBase.reassign_poll_response(second_poll_id,self.poll_id)
        time.sleep(2) #Takes a time for a poll to be reassigned
        PollBase.start_poll(self.browser,self.poll_id)

        SplinterWrapper.open('/polls/%s/report/' % self.poll_id)
        self.assert_that_number_of_responses_is(1)
    def test_that_a_poll_response_can_be_reassigned_to_another_poll(self):
        second_poll_id = PollBase.create_poll(
            self.browser,
            name='Second Poll',
            type="Yes/No Question",
            question="Is the first poll working?",
            group="groupFT")
        PollBase.start_poll(self.browser, second_poll_id)

        PollBase.respond_to_the_started_poll("0794339344", "yes")
        PollBase.close_poll(second_poll_id)

        PollBase.reassign_poll_response(second_poll_id, self.poll_id)
        time.sleep(2)  #Takes a time for a poll to be reassigned
        PollBase.start_poll(self.browser, self.poll_id)

        SplinterWrapper.open('/polls/%s/report/' % self.poll_id)
        self.assert_that_number_of_responses_is(1)
 def setUpClass(cls):
     PollBase.start_poll(cls.browser,cls.poll_id)
     AdminBase.change_users_group("groupFT")