def test_successful_addition_and_editing_of_data_sender(self): add_data_sender_page = self.current_page add_data_sender_page.enter_data_sender_details_from(VALID_DATA) success_msg = add_data_sender_page.get_success_message() self.assertIn(fetch_(SUCCESS_MSG, from_(VALID_DATA)), success_msg) rep_id = self._parse(success_msg) all_data_senders_page = AllDataSendersPage(self.driver) all_data_senders_page.load() all_data_senders_page.search_with(rep_id) all_data_senders_page.select_a_data_sender_by_id(rep_id) all_data_senders_page.select_edit_action() self.current_page.enter_data_sender_details_from(VALID_EDIT_DATA) self.assertRegexpMatches(self.current_page.get_success_message(), fetch_(SUCCESS_MSG, from_(VALID_EDIT_DATA)))
class TestAllDatasenderBehaviourInTrialOrg(HeadlessRunnerTest): @classmethod def setUpClass(cls): HeadlessRunnerTest.setUpClass() @attr('functional_test') def test_should_show_default_datasender_for_newly_created_datasender(self): registration_confirmation_page, self.email = register_and_get_email(self.driver) assert REGISTRATION_SUCCESS_MESSAGE == registration_confirmation_page.registration_success_message() self.account_activate_page = ActivateAccountPage(self.driver) self.postgres_dbmanager = DatabaseManager() self.activation_code = self.postgres_dbmanager.get_activation_code(self.email.lower()) self.account_activate_page.activate_account(self.activation_code) self.page = AllDataSendersPage(self.driver) self.page.load() all_ds_page = self.page self.assertEqual(1, all_ds_page.get_datasenders_count())