Pārlūkot izejas kodu

Captured stderr during admin_docs test.

The admindocs app doesn't pass a log level to docutils when it parses
reStructured Text, so system messages can be logged during parsing.
Adam Zapletal 1 mēnesi atpakaļ
vecāks
revīzija
9a71eca64b
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      tests/admin_docs/test_views.py

+ 2 - 1
tests/admin_docs/test_views.py

@@ -509,7 +509,8 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
             codename="change_person", content_type=person_content_type
         )
         staff_user.user_permissions.add(view_company, change_person)
-        response_for_person = self.client.get(person_url)
+        with captured_stderr():
+            response_for_person = self.client.get(person_url)
         response_for_company = self.client.get(company_url)
         # View or change permission grants access.
         self.assertEqual(response_for_person.status_code, 200)