mirror of
https://github.com/django/django.git
synced 2025-03-12 18:30:48 +00:00
[5.2.x] 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. Backport of 9a71eca64bd3a357ef4846d81668d690089779c7 from main.
This commit is contained in:
parent
e9576c0aa8
commit
b285cc787e
@ -509,7 +509,8 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
|
|||||||
codename="change_person", content_type=person_content_type
|
codename="change_person", content_type=person_content_type
|
||||||
)
|
)
|
||||||
staff_user.user_permissions.add(view_company, change_person)
|
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)
|
response_for_company = self.client.get(company_url)
|
||||||
# View or change permission grants access.
|
# View or change permission grants access.
|
||||||
self.assertEqual(response_for_person.status_code, 200)
|
self.assertEqual(response_for_person.status_code, 200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user