-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for resolved feedback notification
- Loading branch information
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from freezegun import freeze_time | ||
|
||
from plugins.models import Plugin, PluginVersion, PluginVersionFeedback | ||
from plugins.views import version_feedback_notify | ||
from plugins.views import version_feedback_notify, version_feedback_resolved_notify | ||
from django.conf import settings | ||
from django.utils.dateformat import format | ||
import json | ||
|
@@ -138,6 +138,22 @@ def test_non_staff_should_not_see_plugin_feedback_completed_list(self): | |
self.client.force_login(user=self.creator) | ||
response = self.client.get(self.url) | ||
self.assertEqual(response.status_code, 404) | ||
|
||
def test_version_feedback_resolved_notify(self): | ||
|
||
with self.assertLogs(level='DEBUG'): | ||
version_feedback_resolved_notify(self.version_1, self.staff) | ||
self.assertEqual( | ||
mail.outbox[0].recipients(), | ||
['[email protected]', '[email protected]'] | ||
) | ||
|
||
# Should use the new email | ||
self.assertEqual( | ||
mail.outbox[0].from_email, | ||
settings.EMAIL_HOST_USER | ||
) | ||
|
||
|
||
def test_staff_should_see_plugin_feedback_completed(self): | ||
self.client.force_login(user=self.staff) | ||
|