예제 #1
0
 def start_poll(cls, browser, poll_id):
     SplinterWrapper.open("/view_poll/%s " % poll_id)
     if len(browser.find_link_by_text('Start Poll')) > 0:
         browser.find_link_by_text('Start Poll').first.click()
         time.sleep(2)  #Sending questions is an asynchronous process
     elif len(browser.find_link_by_text('Reopen Poll')) > 0:
         PollBase.reopen_poll(browser, poll_id)
예제 #2
0
 def reply_poll_to_an_ureporter(cls, poll_id, message):
     SplinterWrapper.open("/%s/responses/" % poll_id)
     responses_all = cls.browser.find_by_id("input_select_all").first
     responses_all.check()
     cls.browser.fill("text", message)
     reply_link = cls.browser.find_link_by_text("Reply to selected")
     reply_link.click()
    def test_login_redirects_to_admin_dashboard_on_success(self):
        SplinterWrapper.open("/accounts/logout")
        SplinterWrapper.open("/accounts/login")
        fill_form(self.browser, {"username": "******", "password":"******"}, True, True)
        self.browser.find_by_value("Login").first.click()

        self.assertEqual(self.browser.is_text_present('Add New Poll'), True)
 def tearDownClass(cls):
     cls.delete_poll()
     cls.cleanup("/admin/rapidsms/connection/")
     cls.cleanup("/admin/rapidsms/backend/")
     cls.cleanup("/admin/rapidsms/contact/")
     cls.cleanup("/admin/auth/group/")
     SplinterWrapper.open('/account/logout')
 def start_poll(cls,browser, poll_id):
     SplinterWrapper.open("/view_poll/%s " % poll_id)
     if len(browser.find_link_by_text('Start Poll')) > 0:
         browser.find_link_by_text('Start Poll').first.click()
         time.sleep(2) #Sending questions is an asynchronous process
     elif len(browser.find_link_by_text('Reopen Poll')) > 0:
         PollBase.reopen_poll(browser,poll_id)
 def cleanup(cls, url):
     SplinterWrapper.open(url)
     if cls.browser.is_element_present_by_id("action-toggle"):
         fill_form(cls.browser, {"action-toggle": True})
         fill_form_and_submit(cls.browser, {"action": "delete_selected"},
                              "index", True, True)
         cls.browser.find_by_value("Yes, I'm sure").first.click()
 def reply_poll_to_an_ureporter(cls, poll_id, message):
     SplinterWrapper.open("/%s/responses/" % poll_id)
     responses_all = cls.browser.find_by_id("input_select_all").first
     responses_all.check()
     cls.browser.fill("text", message)
     reply_link = cls.browser.find_link_by_text("Reply to selected")
     reply_link.click()
예제 #8
0
    def create_poll(cls, browser, name, type, question, group):
        SplinterWrapper.open("/createpoll/")
        form_data = {"id_type": type, "id_name": name, "id_groups": group}
        browser.fill("question_en", question)
        fill_form(browser, form_data)
        browser.find_by_css(".buttons a").last.click()

        return browser.url.split('/')[-2]
    def test_should_show_the_status_page(self):
        SplinterWrapper.open("/poll_status/%s" % self.poll_id)

        self.assertEqual(self.browser.is_element_present_by_id('poll-details'), True)
        self.assertTrue(self.poll_id in self.browser.find_by_id("poll-details").first.text)
        self.assertEqual(self.browser.find_by_id('contact-count').text, "1")
        self.assertEqual(self.browser.find_by_id('category-count').text, "3")
        self.assertEqual(self.browser.find_by_id('is-yesno').text, "yes")
예제 #10
0
 def reassign_poll_response(cls, poll_id, second_poll_id):
     SplinterWrapper.open("/%s/responses/" % poll_id)
     responses_all = cls.browser.find_by_id("input_select_all").first
     responses_all.check()
     elements = cls.browser.find_by_id("id_poll")
     elements.first.find_by_value(second_poll_id).first._element.click()
     assign_link = cls.browser.find_link_by_text("Assign selected to poll")
     assign_link.click()
 def assert_that_poll_question_are_sent_out_to_contacts(self, number_of_contact_for_poll, question):
     SplinterWrapper.open('/router/console')
     rows = rows_of_table_by_class(self.browser, 'messages module')
     total = 0
     for row in rows:
         if row.find_by_tag('td').first.text == question:
             total += 1
     self.assertEqual(total, number_of_contact_for_poll)
 def reassign_poll_response(cls, poll_id, second_poll_id):
     SplinterWrapper.open("/%s/responses/" % poll_id)
     responses_all = cls.browser.find_by_id("input_select_all").first
     responses_all.check()
     elements = cls.browser.find_by_id("id_poll")
     elements.first.find_by_value(second_poll_id).first._element.click()
     assign_link = cls.browser.find_link_by_text("Assign selected to poll")
     assign_link.click()
 def assert_that_poll_question_are_sent_out_to_contacts(
         self, number_of_contact_for_poll, question):
     SplinterWrapper.open('/router/console')
     rows = rows_of_table_by_class(self.browser, 'messages module')
     total = 0
     for row in rows:
         if row.find_by_tag('td').first.text == question:
             total += 1
     self.assertEqual(total, number_of_contact_for_poll)
예제 #14
0
    def respond_to_the_started_poll(cls, sender, message):
        SplinterWrapper.open('/router/console/')
        rows_responses = rows_of_table_by_class(cls.browser, "messages module")
        number_of_responses = len(rows_responses)

        form_data = {"text": message, "sender": sender}
        fill_form(cls.browser, form_data, True)
        cls.browser.find_by_css("input[type=submit]").first.click()
        return number_of_responses
    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_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_login_redirects_to_admin_dashboard_on_success(self):
        SplinterWrapper.open("/accounts/logout")
        SplinterWrapper.open("/accounts/login")
        fill_form(self.browser, {
            "username": "******",
            "password": "******"
        }, True, True)
        self.browser.find_by_value("Login").first.click()

        self.assertEqual(self.browser.is_text_present('Add New Poll'), True)
    def assert_that_poll_end_date_is_none(self, poll_id):
        SplinterWrapper.open('/mypolls/%s' % poll_id)

        elements = self.browser.find_by_xpath('//*[@class="results"]')
        tbody = elements.first.find_by_tag('tbody')
        trs = tbody.find_by_tag('tr')
        view_poll_link = '/view_poll/%s/' % poll_id
        for tr in trs:
            element = tr.find_by_xpath('//*[@href="%s"]' % view_poll_link).first
            if element is not None:
                start_date = date.today().strftime("%d/%m/%Y")
                self.assertTrue(tr.find_by_value(start_date) is not None)
    def respond_to_the_started_poll(cls, sender, message):
        SplinterWrapper.open('/router/console/')
        rows_responses = rows_of_table_by_class(cls.browser, "messages module")
        number_of_responses = len(rows_responses)

        form_data = {
            "text": message,
            "sender": sender
        }
        fill_form(cls.browser, form_data, True)
        cls.browser.find_by_css("input[type=submit]").first.click()
        return number_of_responses
    def create_poll(cls, browser, name, type, question, group):
        SplinterWrapper.open("/createpoll/")
        form_data = {
            "id_type": type,
            "id_name": name,
            "id_groups": group
        }
        browser.fill("question_en", question)
        fill_form(browser, form_data)
        browser.find_by_css(".buttons a").last.click()

        return browser.url.split('/')[-2]
    def assert_that_poll_end_date_is_none(self, poll_id):
        SplinterWrapper.open('/mypolls/%s' % poll_id)

        elements = self.browser.find_by_xpath('//*[@class="results"]')
        tbody = elements.first.find_by_tag('tbody')
        trs = tbody.find_by_tag('tr')
        view_poll_link = '/view_poll/%s/' % poll_id
        for tr in trs:
            element = tr.find_by_xpath('//*[@href="%s"]' %
                                       view_poll_link).first
            if element is not None:
                start_date = date.today().strftime("%d/%m/%Y")
                self.assertTrue(tr.find_by_value(start_date) is not None)
예제 #22
0
 def create_contact(cls, browser, name, gender, backend_name, identity, group):
     SplinterWrapper.open("/admin/rapidsms/contact/add/")
     form_data = {
         "id_name": name,
         "id_gender": gender,
         "id_birthdate_0": datetime.now().strftime("%Y-%m-%d"),
         "id_birthdate_1": "00:00:00",
         "id_reporting_location": ("%s" % REPORTING_LOCATION_ID_KAMAIBA),
         "id_connection_set-0-backend": backend_name,
         "id_connection_set-0-identity": identity,
         "id_groups": group
     }
     fill_form_and_submit(browser, form_data, "_save")
    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)
예제 #25
0
class AdminBase():
    browser = SplinterWrapper.getBrowser()

    @classmethod
    def create_backend(cls, browser, name):
        SplinterWrapper.open("/admin/rapidsms/backend/add/")
        fill_form_and_submit(browser, {"id_name": name}, "_save")

    @classmethod
    def create_contact(cls, browser, name, gender, backend_name, identity, group):
        SplinterWrapper.open("/admin/rapidsms/contact/add/")
        form_data = {
            "id_name": name,
            "id_gender": gender,
            "id_birthdate_0": datetime.now().strftime("%Y-%m-%d"),
            "id_birthdate_1": "00:00:00",
            "id_reporting_location": ("%s" % REPORTING_LOCATION_ID_KAMAIBA),
            "id_connection_set-0-backend": backend_name,
            "id_connection_set-0-identity": identity,
            "id_groups": group
        }
        fill_form_and_submit(browser, form_data, "_save")

    @classmethod
    def create_group(cls, browser, name):
        SplinterWrapper.open("/admin/auth/group/add/")
        fill_form_and_submit(browser, {"id_name": name}, "_save")

    def create_user(self, name, group):
        SplinterWrapper.open("/admin/auth/user/add/")
        fill_form_and_submit(self.browser, {"id_username": name, "id_password1": name, "id_password2": name}, "_save")
        fill_form_and_submit(self.browser, {"id_groups": group}, "_save")

    @classmethod
    def change_users_group(cls, group_name):
        SplinterWrapper.open("/admin/auth/user")
        cls.browser.click_link_by_text("ureport")

        fill_form_and_submit(cls.browser, {"id_groups": group_name}, "_save")

    @classmethod
    def log_in_as_ureport(cls):
        SplinterWrapper.open('/accounts/login')
        if cls.browser.is_element_present_by_name("username"):
            cls.browser.fill("username", "ureport")
            cls.browser.fill("password", "ureport")
            cls.browser.find_by_css("input[type=submit]").first.click()

    def log_as_admin_and_visit(self, url):
        self.create_and_sign_in_admin("ureport", "ureport", url)

    def cleanup(self, url):
        self.open(url)
        if self.browser.is_element_present_by_id("action-toggle"):
            fill_form(self.browser, {"action-toggle": True})
            fill_form_and_submit(self.browser, {"action": "delete_selected"}, "index", True, True)
            self.browser.find_by_value("Yes, I'm sure").first.click()
    def test_that_polls_can_be_responded(self):
        SplinterWrapper.open('/router/console/')
        number_of_responses = len(rows_of_table_by_class(self.browser, "messages module"))
        self.respond_to_the_started_poll("0794339344", "yes")

        self.assert_that_number_of_responses_increase_by(number_of_responses, 1)
 def test_that_poll_status_changes_when_started(self):
     SplinterWrapper.open("/poll_status/%s" % self.poll_id)
     self.assert_that_poll_start_date_is_not_none(self.poll_id)
 def assert_that_message_has_been_sent_out_to_ureporter(self, message):
     SplinterWrapper.open("/router/console")
     element = self.browser.find_by_xpath(
         "//table/tbody/tr/td[text()='%s']" % message)
     self.assertEquals(element.first.text, message)
예제 #29
0
 def create_user(self, name, group):
     SplinterWrapper.open("/admin/auth/user/add/")
     fill_form_and_submit(self.browser, {"id_username": name, "id_password1": name, "id_password2": name}, "_save")
     fill_form_and_submit(self.browser, {"id_groups": group}, "_save")
 def assert_that_poll_start_date_is_not_none(self, poll_id):
     SplinterWrapper.open('/mypolls/%s' % poll_id)
     start_date = self.browser.find_by_xpath(
         '//*[@class="results"]/tbody/tr[2]/td[3]')
     date_today = date.today().strftime("%d/%m/%Y")
     self.assertEquals(start_date.text, date_today)
class PollFlowTest(unittest.TestCase,PollBase,PollAssertions):
    browser = SplinterWrapper.getBrowser()
    AdminBase.log_in_as_ureport()
    poll_id, question = PollBase.setup_poll(browser)
    opener = login_as_admin('ureport','ureport')

    @classmethod
    def setUpClass(cls):
        PollBase.start_poll(cls.browser,cls.poll_id)
        AdminBase.change_users_group("groupFT")

    @classmethod
    def cleanup(cls, url):
        SplinterWrapper.open(url)
        if cls.browser.is_element_present_by_id("action-toggle"):
            fill_form(cls.browser, {"action-toggle": True})
            fill_form_and_submit(cls.browser, {"action": "delete_selected"}, "index", True, True)
            cls.browser.find_by_value("Yes, I'm sure").first.click()

    @classmethod
    def delete_poll(cls):
        delete_url = build_url('/polls/%s/delete/' % cls.poll_id)
        post(cls.opener, delete_url)

    def tearDown(self):
        responses = PollBase.get_poll_responses_ids(self.browser, self.poll_id)
        for response in responses:
            delete_responses_url = build_url('/polls/responses/%s/delete/' % response.value)
            post(self.opener, delete_responses_url)

    @classmethod
    def tearDownClass(cls):
        cls.delete_poll()
        cls.cleanup("/admin/rapidsms/connection/")
        cls.cleanup("/admin/rapidsms/backend/")
        cls.cleanup("/admin/rapidsms/contact/")
        cls.cleanup("/admin/auth/group/")
        SplinterWrapper.open('/account/logout')

    def test_that_poll_status_changes_when_started(self):
        SplinterWrapper.open("/poll_status/%s" % self.poll_id)
        self.assert_that_poll_start_date_is_not_none(self.poll_id)

    def test_that_poll_can_be_sent_out_to_contacts(self):
         self.assert_that_poll_question_are_sent_out_to_contacts(1, 'What is your name')

    def test_that_polls_can_be_responded(self):
        SplinterWrapper.open('/router/console/')
        number_of_responses = len(rows_of_table_by_class(self.browser, "messages module"))
        self.respond_to_the_started_poll("0794339344", "yes")

        self.assert_that_number_of_responses_increase_by(number_of_responses, 1)

    def test_that_polls_can_be_reopen(self):
        SplinterWrapper.open("/view_poll/%s" % self.poll_id)
        PollBase.close_poll(self.poll_id)
        self.browser.find_link_by_text('Reopen Poll').first.click()

        self.assert_that_poll_end_date_is_none(self.poll_id)

    def test_that_admin_is_able_to_add_new_poll(self):
        SplinterWrapper.open('/mypolls/%s' % self.poll_id)
        self.assert_that_page_has_add_poll_button()

    def test_should_show_the_status_page(self):
        SplinterWrapper.open("/poll_status/%s" % self.poll_id)

        self.assertEqual(self.browser.is_element_present_by_id('poll-details'), True)
        self.assertTrue(self.poll_id in self.browser.find_by_id("poll-details").first.text)
        self.assertEqual(self.browser.find_by_id('contact-count').text, "1")
        self.assertEqual(self.browser.find_by_id('category-count').text, "3")
        self.assertEqual(self.browser.find_by_id('is-yesno').text, "yes")

    def test_admin_can_search_for_ureporter(self):
        group_name = "groupFT"
        self.respond_to_the_started_poll("0794339344", "yes")
        SplinterWrapper.open( '/reporter/')
        self.search_by_ureporter_group("%s" % group_name)
        self.assertEquals(True, self.browser.is_text_present("0794339344"))

    def search_by_ureporter_group(self, group_name):
        element_list_matching_option = self.browser.find_option_by_text(group_name)
        self.browser.select("groups", element_list_matching_option.first.value)
        self.browser.click_link_by_partial_text("Update")
        return self
 def assert_that_number_of_responses_increase_by(self, number_of_responses,
                                                 increment):
     SplinterWrapper.open('/router/console')
     rows_responses = rows_of_table_by_class(self.browser,
                                             "messages module")
     self.assertEqual(len(rows_responses), number_of_responses + increment)
 def close_poll(cls, poll_id):
     SplinterWrapper.open("/view_poll/%s" % poll_id)
     if len(cls.browser.find_link_by_text('Close Poll')) > 0:
         cls.browser.find_link_by_text('Close Poll').first.click()
 def reopen_poll(cls,browser, poll_id):
     SplinterWrapper.open("/view_poll/%s " % poll_id)
     browser.find_link_by_text('Reopen Poll').first.click()
class PollResponsesTest(unittest.TestCase, PollAssertions):
    browser = SplinterWrapper.getBrowser()

    def tearDown(self):
        responses = PollBase.get_poll_responses_ids(self.browser, self.poll_id)
        for response in responses:
            delete_responses_url = build_url('/polls/responses/%s/delete/' %
                                             response.value)
            post(self.opener, delete_responses_url)
        PollBase.close_poll(self.poll_id)

    @classmethod
    def setUpClass(cls):
        AdminBase.log_in_as_ureport()
        cls.poll_id, cls.question = PollBase.setup_poll(
            cls.browser, question="This is a new poll.")
        AdminBase.change_users_group("groupFT")
        cls.opener = login_as_admin('ureport', 'ureport')

    @classmethod
    def cleanup(cls, url):
        SplinterWrapper.open(url)
        if cls.browser.is_element_present_by_id("action-toggle"):
            fill_form(cls.browser, {"action-toggle": True})
            fill_form_and_submit(cls.browser, {"action": "delete_selected"},
                                 "index", True, True)
            cls.browser.find_by_value("Yes, I'm sure").first.click()

    @classmethod
    def delete_poll(cls):
        delete_url = build_url('/polls/%s/delete/' % cls.poll_id)
        post(cls.opener, delete_url)

    @classmethod
    def tearDownClass(cls):
        cls.delete_poll()
        cls.cleanup("/admin/rapidsms/connection/")
        cls.cleanup("/admin/rapidsms/backend/")
        cls.cleanup("/admin/rapidsms/contact/")
        cls.cleanup("/admin/auth/group/")

    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_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)
예제 #36
0
 def log_in_as_ureport(cls):
     SplinterWrapper.open('/accounts/login')
     if cls.browser.is_element_present_by_name("username"):
         cls.browser.fill("username", "ureport")
         cls.browser.fill("password", "ureport")
         cls.browser.find_by_css("input[type=submit]").first.click()
예제 #37
0
    def change_users_group(cls, group_name):
        SplinterWrapper.open("/admin/auth/user")
        cls.browser.click_link_by_text("ureport")

        fill_form_and_submit(cls.browser, {"id_groups": group_name}, "_save")
    def test_that_polls_can_be_reopen(self):
        SplinterWrapper.open("/view_poll/%s" % self.poll_id)
        PollBase.close_poll(self.poll_id)
        self.browser.find_link_by_text('Reopen Poll').first.click()

        self.assert_that_poll_end_date_is_none(self.poll_id)
 def get_poll_responses_ids(cls, browser, poll_id):
     SplinterWrapper.open("/%s/responses/" % poll_id)
     return browser.find_by_xpath('//input[@type="checkbox" and @name="results"]')
 def test_that_admin_is_able_to_add_new_poll(self):
     SplinterWrapper.open('/mypolls/%s' % self.poll_id)
     self.assert_that_page_has_add_poll_button()
 def assert_that_message_has_been_sent_out_to_ureporter(self, message):
     SplinterWrapper.open( "/router/console")
     element =self.browser.find_by_xpath("//table/tbody/tr/td[text()='%s']" % message)
     self.assertEquals(element.first.text, message)
 def test_admin_can_search_for_ureporter(self):
     group_name = "groupFT"
     self.respond_to_the_started_poll("0794339344", "yes")
     SplinterWrapper.open( '/reporter/')
     self.search_by_ureporter_group("%s" % group_name)
     self.assertEquals(True, self.browser.is_text_present("0794339344"))
 def assert_that_number_of_responses_increase_by(self, number_of_responses, increment):
     SplinterWrapper.open('/router/console')
     rows_responses = rows_of_table_by_class(self.browser, "messages module")
     self.assertEqual(len(rows_responses), number_of_responses + increment)
 def cleanup(cls, url):
     SplinterWrapper.open(url)
     if cls.browser.is_element_present_by_id("action-toggle"):
         fill_form(cls.browser, {"action-toggle": True})
         fill_form_and_submit(cls.browser, {"action": "delete_selected"}, "index", True, True)
         cls.browser.find_by_value("Yes, I'm sure").first.click()
 def assert_that_poll_start_date_is_not_none(self, poll_id):
     SplinterWrapper.open('/mypolls/%s' % poll_id)
     start_date = self.browser.find_by_xpath('//*[@class="results"]/tbody/tr[2]/td[3]')
     date_today = date.today().strftime("%d/%m/%Y")
     self.assertEquals(start_date.text, date_today)
예제 #46
0
 def create_group(cls, browser, name):
     SplinterWrapper.open("/admin/auth/group/add/")
     fill_form_and_submit(browser, {"id_name": name}, "_save")
예제 #47
0
 def create_backend(cls, browser, name):
     SplinterWrapper.open("/admin/rapidsms/backend/add/")
     fill_form_and_submit(browser, {"id_name": name}, "_save")