Mercurial > bitten > bitten-test
changeset 624:cc2383034358
Remove user->email lookup from since this is already handled in the parent class
author | mgood |
---|---|
date | Sun, 09 Aug 2009 08:47:02 +0000 |
parents | 31954f250366 |
children | 98675686ec4d |
files | bitten/notify.py bitten/tests/notify.py |
diffstat | 2 files changed, 7 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/bitten/notify.py +++ b/bitten/notify.py @@ -168,11 +168,9 @@ NotifyEmail.notify(self, self.build_info.id, subject) def get_recipients(self, resid): - author = self.build_info.author - author = DetachedSession(self.env, author).get('email') or author - torecipients = [author] - ccrecipients = [] - return (torecipients, ccrecipients) + to = [self.build_info.author] + cc = [] + return (to, cc) def send(self, torcpts, ccrcpts, mime_headers={}): mime_headers = {
--- a/bitten/tests/notify.py +++ b/bitten/tests/notify.py @@ -127,26 +127,13 @@ begin_send=noop, finish_send=noop, send=send) - self.build_info = BuildInfo(self.env, Build(self.env, - status = Build.SUCCESS)) - self.build_info['author'] = 'author' + self.build_info = BuildInfo(self.env, + Build(self.env, status=Build.SUCCESS, rev=123)) - def test_notification_uses_default_address(self): + def test_notification_is_sent_to_author(self): self.email.notify(self.build_info) self.assertTrue('author' in self.notifications_sent_to, - 'recipient list should contain plain author') - - def test_notification_uses_custom_address(self): - self.add_known_user('author', "Author's Name", 'author@email.com') - self.email.notify(self.build_info) - self.assertTrue('author@email.com' in self.notifications_sent_to, - "recipient list should contain custom author's email") - - def test_notification_discards_invalid_address(self): - self.add_known_user('author', "Author's Name", email=None) - self.email.notify(self.build_info) - self.assertTrue('author' in self.notifications_sent_to, - 'recipient list should only use valid custom address') + 'Recipient list should contain the author') def add_known_user(self, username, name, email): session = DetachedSession(self.env, username)