зеркало из https://github.com/mozilla/kitsune.git
[bug 652001] Upgrade to django-tidings 0.1.
This commit is contained in:
Родитель
5e958ad664
Коммит
131701d930
|
@ -29,7 +29,7 @@ class QuestionEvent(InstanceEvent):
|
|||
template_path = 'questions/email/activate_watch.ltxt'
|
||||
message = loader.render_to_string(template_path, email_kwargs)
|
||||
return EmailMessage(subject, message,
|
||||
settings.NOTIFICATIONS_FROM_ADDRESS, [email])
|
||||
settings.TIDINGS_FROM_ADDRESS, [email])
|
||||
|
||||
@classmethod
|
||||
def _activation_url(cls, watch):
|
||||
|
@ -72,7 +72,7 @@ class QuestionReplyEvent(QuestionEvent):
|
|||
yield EmailMessage(asker_subject if is_asker
|
||||
else watcher_subject,
|
||||
content,
|
||||
settings.NOTIFICATIONS_FROM_ADDRESS,
|
||||
settings.TIDINGS_FROM_ADDRESS,
|
||||
[u.email])
|
||||
|
||||
@classmethod
|
||||
|
@ -105,7 +105,7 @@ class QuestionSolvedEvent(QuestionEvent):
|
|||
yield EmailMessage(
|
||||
subject,
|
||||
content,
|
||||
settings.NOTIFICATIONS_FROM_ADDRESS,
|
||||
settings.TIDINGS_FROM_ADDRESS,
|
||||
[u.email])
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -148,7 +148,7 @@ class NotificationsTests(TestCaseBase):
|
|||
return question
|
||||
|
||||
@mock.patch.object(Site.objects, 'get_current')
|
||||
@mock.patch.object(settings._wrapped, 'CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
@mock.patch.object(settings._wrapped, 'TIDINGS_CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
def test_solution_notification(self, get_current):
|
||||
"""Assert that hitting the watch toggle toggles and that proper mails
|
||||
are sent to anonymous and registered watchers."""
|
||||
|
@ -176,7 +176,7 @@ class NotificationsTests(TestCaseBase):
|
|||
self._toggle_watch_question('solution', turn_on=False)
|
||||
|
||||
@mock.patch.object(Site.objects, 'get_current')
|
||||
@mock.patch.object(settings._wrapped, 'CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
@mock.patch.object(settings._wrapped, 'TIDINGS_CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
def test_answer_notification(self, get_current):
|
||||
"""Assert that hitting the watch toggle toggles and that proper mails
|
||||
are sent to anonymous users, registered users, and the question
|
||||
|
|
|
@ -25,7 +25,7 @@ def notification_mails(revision, subject, template, url, users_and_watches):
|
|||
'creator': revision.creator,
|
||||
'url': url,
|
||||
'host': Site.objects.get_current().domain}
|
||||
mail = EmailMessage(subject, '', settings.NOTIFICATIONS_FROM_ADDRESS)
|
||||
mail = EmailMessage(subject, '', settings.TIDINGS_FROM_ADDRESS)
|
||||
|
||||
for u, w in users_and_watches:
|
||||
c['watch'] = w
|
||||
|
|
|
@ -44,7 +44,7 @@ def send_reviewed_notification(revision, document, message):
|
|||
'message': message,
|
||||
'url': url,
|
||||
'host': Site.objects.get_current().domain}))
|
||||
send_mail(subject, content, settings.NOTIFICATIONS_FROM_ADDRESS,
|
||||
send_mail(subject, content, settings.TIDINGS_FROM_ADDRESS,
|
||||
[revision.creator.email])
|
||||
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ class NewRevisionTests(TestCaseBase):
|
|||
eq_(doc('#id_content')[0].value, r.content)
|
||||
|
||||
@mock.patch.object(Site.objects, 'get_current')
|
||||
@mock.patch.object(settings._wrapped, 'CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
@mock.patch.object(settings._wrapped, 'TIDINGS_CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
def test_new_revision_POST_document_with_current(self, get_current):
|
||||
"""HTTP POST to new revision URL creates the revision on a document.
|
||||
|
||||
|
@ -759,7 +759,7 @@ class ReviewRevisionTests(TestCaseBase):
|
|||
|
||||
@mock.patch.object(send_reviewed_notification, 'delay')
|
||||
@mock.patch.object(Site.objects, 'get_current')
|
||||
@mock.patch.object(settings._wrapped, 'CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
@mock.patch.object(settings._wrapped, 'TIDINGS_CONFIRM_ANONYMOUS_WATCHES', False)
|
||||
def test_approve_revision(self, get_current, reviewed_delay):
|
||||
"""Verify revision approval with proper notifications."""
|
||||
get_current.return_value.domain = 'testserver'
|
||||
|
|
|
@ -605,12 +605,11 @@ TWITTER_CONSUMER_KEY = ''
|
|||
TWITTER_CONSUMER_SECRET = ''
|
||||
|
||||
|
||||
NOTIFICATIONS_FROM_ADDRESS = 'notifications@support.mozilla.com'
|
||||
TIDINGS_FROM_ADDRESS = 'notifications@support.mozilla.com'
|
||||
# Anonymous watches must be confirmed.
|
||||
CONFIRM_ANONYMOUS_WATCHES = True
|
||||
NOTIFICATIONS_MODEL_BASE = 'sumo.models.ModelBase'
|
||||
NOTIFICATIONS_REVERSE = 'sumo.urlresolvers.reverse'
|
||||
NOTIFICATIONS_TEST_CASE = 'sumo.tests.TestCase'
|
||||
TIDINGS_CONFIRM_ANONYMOUS_WATCHES = True
|
||||
TIDINGS_MODEL_BASE = 'sumo.models.ModelBase'
|
||||
TIDINGS_REVERSE = 'sumo.urlresolvers.reverse'
|
||||
|
||||
|
||||
# URL of the chat server.
|
||||
|
|
2
vendor
2
vendor
|
@ -1 +1 @@
|
|||
Subproject commit dfc433744b7f134c03c641e30ee7fd6bb1b3a469
|
||||
Subproject commit 8cb8c6aea13bbafbcd92e4ed523e2e0432d8d284
|
Загрузка…
Ссылка в новой задаче