diff options
author | 2019-11-20 18:21:16 +0100 | |
---|---|---|
committer | 2019-11-20 18:21:16 +0100 | |
commit | 8e4ed686ebe06e8e15604d204969042efb434b30 (patch) | |
tree | 0aae245951f5f6b7e7b05eccc12e642c4c802a61 /pydis_site/apps/staff | |
parent | Write tests for message.attachments (diff) |
Test for the attachment image to be in the staff log
Diffstat (limited to 'pydis_site/apps/staff')
-rw-r--r-- | pydis_site/apps/staff/tests/test_logs_view.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pydis_site/apps/staff/tests/test_logs_view.py b/pydis_site/apps/staff/tests/test_logs_view.py index b01e3f3e..1415c558 100644 --- a/pydis_site/apps/staff/tests/test_logs_view.py +++ b/pydis_site/apps/staff/tests/test_logs_view.py @@ -151,6 +151,21 @@ class TestLogsView(TestCase): self.assertInHTML(embed_colour_needle.format(colour=embed_one_colour), html_response) self.assertInHTML(embed_colour_needle.format(colour=embed_two_colour), html_response) + def test_if_both_attachments_are_included_html_response(self): + url = reverse('logs', host="staff", args=(self.deletion_context.id,)) + response = self.client.get(url) + + html_response = response.content.decode() + attachment_needle = '<img alt="Attachment" class="discord-attachment" src="{url}">' + self.assertInHTML( + attachment_needle.format(url=self.deleted_message_two.attachments[0]), + html_response + ) + self.assertInHTML( + attachment_needle.format(url=self.deleted_message_two.attachments[1]), + html_response + ) + def test_if_html_in_content_is_properly_escaped(self): url = reverse('logs', host="staff", args=(self.deletion_context.id,)) response = self.client.get(url) |