self.smtpd.store.reset(None) def _subject(self, raw_message): message = email.message_from_string(raw_message) # If the subject line is too long, the line will we wrapped # Python's email module does not remove the line endings automatically subject = message['Subject'].replace('\n', '').replace('\r', '') return subject def runTest(self): self.tester.login_as(Usernames.team_member) task_id = self.tester.create_new_agilo_task('My first task') self._consume_ticket_creation_notification_mail(task_id) self.json_tester.login_as(Usernames.team_member) new_summary = 'Notification Task' new_task_attributes = {Key.SUMMARY: new_summary} self.json_tester.edit_ticket(task_id, **new_task_attributes) self.tester.go_to_view_ticket_page(task_id) tc.find(new_summary) self.assertTrue('*****@*****.**' in self.smtpd.get_recipients()) subject = self._subject(self.smtpd.get_message()) self.assertTrue(new_summary in subject, repr(subject)) if __name__ == '__main__': from agilo.test import run_all_tests run_all_tests(__file__)
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import agilo.utils.filterwarnings from agilo.test import Usernames from agilo.test.functional import AgiloFunctionalTestCase class SprintBacklogViewButtonIsDisabledWhenListIsEmpty(AgiloFunctionalTestCase): testtype = 'windmill' def runTest(self): self.teh.delete_all_sprints() self.windmill_tester.login_as(Usernames.admin) is_button_disabled = self.windmill_tester.output_for_js("$('[name=sprint_view] [name=view]').is(':disabled')") self.assert_true(is_button_disabled) if __name__ == '__main__': from agilo.test import run_all_tests run_all_tests(__file__)