# HG changeset patch # User mgood # Date 1249807622 0 # Node ID cc23830343580965376ed87d4968861b843c7e99 # Parent 31954f250366a71f9acb2fbf354b705542a3e219 Remove user->email lookup from since this is already handled in the parent class diff --git a/bitten/notify.py b/bitten/notify.py --- 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 = { diff --git a/bitten/tests/notify.py b/bitten/tests/notify.py --- 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)