Skip to content

Commit

Permalink
Remove use of captured_stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahboyce committed Nov 29, 2023
1 parent dfa7429 commit 750a559
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions blog/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datetime import timedelta
from test.support import captured_stderr

from django.test import TestCase
from django.urls import reverse
Expand Down Expand Up @@ -64,15 +63,14 @@ def test_docutils_safe(self):
"""
Make sure docutils' file inclusion directives are disabled by default.
"""
with captured_stderr() as self.docutils_stderr:
entry = Entry.objects.create(
pub_date=self.now,
is_active=True,
headline="active",
content_format="reST",
body=".. raw:: html\n :file: somefile\n",
slug="a",
)
entry = Entry.objects.create(
pub_date=self.now,
is_active=True,
headline="active",
content_format="reST",
body=".. raw:: html\n :file: somefile\n",
slug="a",
)
self.assertIn("<p>&quot;raw&quot; directive disabled.</p>", entry.body_html)
self.assertIn(".. raw:: html\n :file: somefile", entry.body_html)

Expand Down

0 comments on commit 750a559

Please sign in to comment.