Skip to content

Commit

Permalink
Add unit test for resolved feedback notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Jan 15, 2025
1 parent 448f646 commit 0127faa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion qgis-app/plugins/tests/test_plugin_version_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0127faa

Please sign in to comment.