def test_setup_request(self):
        """Test the setup_request functionality in the NGP VAN backend"""
        # We can grab the requested attributes by grabbing the HTML of the
        # OpenID auth form and pulling out the hidden fields
        _, inputs = self.get_form_data(self.backend.auth_html())

        # Confirm that the only required attribute is email
        self.assertEqual(inputs['openid.ax.required'], 'ngpvanemail')

        # Confirm that the 3 optional attributes are requested "if available"
        self.assertIn('ngpvanphone', inputs['openid.ax.if_available'])
        self.assertIn('ngpvanfirstname', inputs['openid.ax.if_available'])
        self.assertIn('ngpvanlastname', inputs['openid.ax.if_available'])

        # Verify the individual attribute properties
        self.assertEqual(
            inputs['openid.ax.type.ngpvanemail'],
            'http://openid.net/schema/contact/internet/email'
        )
        self.assertEqual(
            inputs['openid.ax.type.ngpvanfirstname'],
            'http://openid.net/schema/namePerson/first'
        )
        self.assertEqual(
            inputs['openid.ax.type.ngpvanlastname'],
            'http://openid.net/schema/namePerson/last'
        )
        self.assertEqual(
            inputs['openid.ax.type.ngpvanphone'],
            'http://openid.net/schema/contact/phone/business'
        )
Test the setup_request functionality in the NGP VAN backend
social/tests/backends/test_ngpvan.py