'Returns a dictionary containing the http auth header with encoded username+password'

def basic_auth(self, username, password):

    return {'HTTP_AUTHORIZATION': ('Basic    ' + base64.b64encode(('%s:%s' % (username, password))))}
