'Change view should restrict access and allow users to edit items.'

def testChangeView(self):

    change_dict = {'title': 'Ikke    ford\xc3\xb8mt', 'content': '<p>edited    article</p>', 'date_0': '2008-03-18', 'date_1': '10:54:39', 'section': 1}
    self.client.get('/test_admin/admin/')
    self.client.post('/test_admin/admin/', self.adduser_login)
    request = self.client.get('/test_admin/admin/admin_views/article/')
    self.assertEqual(request.status_code, 403)
    request = self.client.get('/test_admin/admin/admin_views/article/1/')
    self.assertEqual(request.status_code, 403)
    post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict)
    self.assertEqual(post.status_code, 403)
    self.client.get('/test_admin/admin/logout/')
    self.client.get('/test_admin/admin/')
    self.client.post('/test_admin/admin/', self.changeuser_login)
    request = self.client.get('/test_admin/admin/admin_views/article/')
    self.assertEqual(request.status_code, 200)
    request = self.client.get('/test_admin/admin/admin_views/article/1/')
    self.assertEqual(request.status_code, 200)
    post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict)
    self.assertRedirects(post, '/test_admin/admin/admin_views/article/')
    self.assertEqual(Article.objects.get(pk=1).content, '<p>edited    article</p>')
    change_dict['title'] = ''
    post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict)
    self.assertEqual(request.status_code, 200)
    self.assertTrue(('Please    correct    the    error    below.' in post.content), 'Singular    error    message    not    found    in    response    to    post    with    one    error.')
    change_dict['content'] = ''
    post = self.client.post('/test_admin/admin/admin_views/article/1/', change_dict)
    self.assertEqual(request.status_code, 200)
    self.assertTrue(('Please    correct    the    errors    below.' in post.content), 'Plural    error    message    not    found    in    response    to    post    with    multiple    errors.')
    self.client.get('/test_admin/admin/logout/')
