def test_incorrectPadding(self):
        """
        L{basic.BasicCredentialFactory.decode} decodes a base64-encoded
        response with incorrect padding.
        """
        response = b64encode(b''.join([self.username, b':', self.password]))
        response = response.strip(b'=')

        creds = self.credentialFactory.decode(response, self.request)
        self.assertTrue(verifyObject(IUsernamePassword, creds))
        self.assertTrue(creds.checkPassword(self.password))

        L{basic.BasicCredentialFactory.decode} decodes a base64-encoded
        response with incorrect padding.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_httpauth.py