Skip to content

Commit

Permalink
[#1635] Rename config option ckan.mail_from -> smtp.mail_from
Browse files Browse the repository at this point in the history
This makes it consistent with the other smtp options it is used with.
  • Loading branch information
Sean Hammond committed Dec 4, 2012
1 parent 794d61b commit 44abd17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/mailer.py
Expand Up @@ -25,7 +25,7 @@ def add_msg_niceties(recipient_name, body, sender_name, sender_url):
def _mail_recipient(recipient_name, recipient_email,
sender_name, sender_url, subject,
body, headers={}):
mail_from = config.get('ckan.mail_from')
mail_from = config.get('smtp.mail_from')
body = add_msg_niceties(recipient_name, body, sender_name, sender_url)
msg = MIMEText(body.encode('utf-8'), 'plain', 'utf-8')
for k, v in headers.items(): msg[k] = v
Expand Down
6 changes: 3 additions & 3 deletions ckan/tests/lib/test_mailer.py
Expand Up @@ -56,7 +56,7 @@ def test_mail_recipient(self):
msgs = self.get_smtp_messages()
assert_equal(len(msgs), 1)
msg = msgs[0]
assert_equal(msg[1], config['ckan.mail_from'])
assert_equal(msg[1], config['smtp.mail_from'])
assert_equal(msg[2], [test_email['recipient_email']])
assert test_email['headers'].keys()[0] in msg[3], msg[3]
assert test_email['headers'].values()[0] in msg[3], msg[3]
Expand All @@ -81,7 +81,7 @@ def test_mail_user(self):
msgs = self.get_smtp_messages()
assert_equal(len(msgs), 1)
msg = msgs[0]
assert_equal(msg[1], config['ckan.mail_from'])
assert_equal(msg[1], config['smtp.mail_from'])
assert_equal(msg[2], [model.User.by_name(u'bob').email])
assert test_email['headers'].keys()[0] in msg[3], msg[3]
assert test_email['headers'].values()[0] in msg[3], msg[3]
Expand All @@ -107,7 +107,7 @@ def test_send_reset_email(self):
msgs = self.get_smtp_messages()
assert_equal(len(msgs), 1)
msg = msgs[0]
assert_equal(msg[1], config['ckan.mail_from'])
assert_equal(msg[1], config['smtp.mail_from'])
assert_equal(msg[2], [model.User.by_name(u'bob').email])
assert 'Reset' in msg[3], msg[3]
test_msg = get_reset_link_body(model.User.by_name(u'bob'))
Expand Down
2 changes: 1 addition & 1 deletion test-core.ini
Expand Up @@ -54,7 +54,7 @@ ckan.template_footer_end = <strong>TEST TEMPLATE_FOOTER_END TEST</strong>

# mailer
test_smtp_server = localhost:6675
ckan.mail_from = info@test.ckan.net
smtp.mail_from = info@test.ckan.net

ckan.locale_default = en

Expand Down

0 comments on commit 44abd17

Please sign in to comment.