def login(self):

        def login():
            '''Send a login request with username and password.'''
            self._request('https://what.cd/login.php',
                          {'username': username, 'password': password}, 'POST')

        if self.session.cookies.get('session', None):
            return

        from getpass import getpass
        print('WhatCD requires authentication with your own account. '
              'Disable whatcd\nin the config file or supply credentials '
              'to receive a session cookie:')
        username = raw_input('Username: ')
        password = getpass("Password: ")

        if requests_cache:
            with self.session.cache_disabled():
                login()
        else:
            login()

        if not self.session.cookies.get('session', None):
            self.log.critical('WhatCD login failed')
            exit()
        # save session cookie to config
        if not self.conf.has_section('whatcd'):
            self.conf.add_section('whatcd')
        cookie = base64.b64encode(self.session.cookies['session'])
        self.conf.set('whatcd', 'session', cookie)
        self.conf.save()
Returns a dict with test data for all the user/profile fields.
dataset/ETHPy150Open YetAnotherNerd/whatlastgenre/wlg/dataprovider.py/WhatCD.login--crossover with--dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/accounts/tests.py/AccountsTests.account_data