mirror of https://github.com/django/django.git
Refs #27804 -- Used subTest in AdminViewPermissionsTest.
This commit is contained in:
parent
d3449faaa9
commit
f5e7506cff
|
@ -1813,6 +1813,7 @@ class AdminViewPermissionsTest(TestCase):
|
|||
change_url_6 = reverse('admin:admin_views_rowlevelchangepermissionmodel_change', args=(r6.pk,))
|
||||
logins = [self.superuser, self.viewuser, self.adduser, self.changeuser, self.deleteuser]
|
||||
for login_user in logins:
|
||||
with self.subTest(login_user.username):
|
||||
self.client.force_login(login_user)
|
||||
response = self.client.get(change_url_1)
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
@ -1838,6 +1839,7 @@ class AdminViewPermissionsTest(TestCase):
|
|||
self.client.get(reverse('admin:logout'))
|
||||
|
||||
for login_user in [self.joepublicuser, self.nostaffuser]:
|
||||
with self.subTest(login_user.username):
|
||||
self.client.force_login(login_user)
|
||||
response = self.client.get(change_url_1, follow=True)
|
||||
self.assertContains(response, 'login-form')
|
||||
|
@ -1997,6 +1999,7 @@ class AdminViewPermissionsTest(TestCase):
|
|||
rl2 = RowLevelChangePermissionModel.objects.create(name="even id")
|
||||
logins = [self.superuser, self.viewuser, self.adduser, self.changeuser, self.deleteuser]
|
||||
for login_user in logins:
|
||||
with self.subTest(login_user.username):
|
||||
self.client.force_login(login_user)
|
||||
url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl1.pk,))
|
||||
response = self.client.get(url)
|
||||
|
@ -2009,6 +2012,7 @@ class AdminViewPermissionsTest(TestCase):
|
|||
self.client.get(reverse('admin:logout'))
|
||||
|
||||
for login_user in [self.joepublicuser, self.nostaffuser]:
|
||||
with self.subTest(login_user.username):
|
||||
self.client.force_login(login_user)
|
||||
url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl1.pk,))
|
||||
response = self.client.get(url, follow=True)
|
||||
|
|
Loading…
Reference in New Issue