'History view should restrict access.'

def test_history_view(self):

    self.client.force_login(self.adduser)
    response = self.client.get(reverse('admin:admin_views_article_history', args=(self.a1.pk,)))
    self.assertEqual(response.status_code, 403)
    self.client.get(reverse('admin:logout'))
    self.client.force_login(self.changeuser)
    response = self.client.get(reverse('admin:admin_views_article_history', args=(self.a1.pk,)))
    self.assertEqual(response.status_code, 200)
    rl1 = RowLevelChangePermissionModel.objects.create(name='odd    id')
    rl2 = RowLevelChangePermissionModel.objects.create(name='even    id')
    for login_user in [self.superuser, self.adduser, self.changeuser, self.deleteuser]:
        self.client.force_login(login_user)
        url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl1.pk,))
        response = self.client.get(url)
        self.assertEqual(response.status_code, 403)
        url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl2.pk,))
        response = self.client.get(url)
        self.assertEqual(response.status_code, 200)
        self.client.get(reverse('admin:logout'))
    for login_user in [self.joepublicuser, self.nostaffuser]:
        self.client.force_login(login_user)
        url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl1.pk,))
        response = self.client.get(url, follow=True)
        self.assertContains(response, 'login-form')
        url = reverse('admin:admin_views_rowlevelchangepermissionmodel_history', args=(rl2.pk,))
        response = self.client.get(url, follow=True)
        self.assertContains(response, 'login-form')
        self.client.get(reverse('admin:logout'))
