def test_follower_add(self):
        url = reverse('follower_add', kwargs={'followee_username': self.user_amy.username})

        # test that the view requires authentication to access it
        response = self.client.get(url)
        self.assertResponse302(response)

        with self.login(self.user_bob.username, self.user_pw):
            response = self.client.get(url)
            self.assertResponse200(response)

            # on POST accept the friendship request and redirect to the
            # friendship_following view
            response = self.client.post(url)
            self.assertResponse302(response)
            redirect_url = reverse('friendship_following', kwargs={'username': self.user_bob.username})
            self.assertTrue(redirect_url in response['Location'])

            response = self.client.post(url)
            self.assertResponse200(response)
            self.assertTrue('errors' in response.context)
            self.assertEqual(response.context['errors'], ["User 'bob' already follows 'amy'"])
dataset/ETHPy150Open revsys/django-friendship/friendship/tests/tests.py/FriendshipViewTests.test_follower_add/original