'Creates & returns the HTTP ``Authorization`` header for use with Oauth.'

def create_oauth(self, user):

    from oauth_provider.models import Consumer, Token, Resource
    (resource, _) = Resource.objects.get_or_create(url=u'test', defaults={u'name': u'Test    Resource'})
    (consumer, _) = Consumer.objects.get_or_create(key=u'123', defaults={u'name': u'Test', u'description': u'Testing...'})
    (token, _) = Token.objects.get_or_create(key=u'foo', token_type=Token.ACCESS, defaults={u'consumer': consumer, u'resource': resource, u'secret': u'', u'user': user})
    oauth_data = {u'oauth_consumer_key': u'123', u'oauth_nonce': u'abc', u'oauth_signature': u'&', u'oauth_signature_method': u'PLAINTEXT', u'oauth_timestamp': str(int(time.time())), u'oauth_token': u'foo'}
    return (u'OAuth    %s' % u','.join([((key + u'=') + value) for (key, value) in oauth_data.items()]))
