mattupstate/flask-social — pull request #18 by maebert (2013-01-29 04:54:23+00:00)
Title: Fixes integration with latest Oauth

Currently, tests fail due to two problems:

#### 1. In `core.py`:

```python
class OAuthRemoteApp(BaseRemoteApp):
def __init__(self, id, module, install, *args, **kwargs):
BaseRemoteApp.__init__(self, None, **kwargs)
```

`kwargs` will usually look like this:

```python
{'name': 'Facebook',
'request_token_params': {'scope': 'email'},
'authorize_url': 'https://www.facebook.com/dialog/oauth',
'base_url': 'https://graph.facebook.com/',
'oauth': {
'consumer_secret': '...',
'consumer_key': '...',
'request_token_params': {'scope': 'email'}
},
'request_token_url': None,
'access_token_url': '/oauth/access_token'
}
```

However, `BaseRemoteApp.__init__` in `oauth` expects `consumer_secret` and `consumer_key` as part of it's `kwargs`:

```python
class OAuthRemoteApp(object):
def __init__(self, oauth, name, base_url,
request_token_url,
access_token_url, authorize_url,
consumer_key, consumer_secret,
request_token_params=None,
access_token_params=None,
access_token_method='GET'):
```

Hence failing because the `oauth` keyword is used twice. This is addressed by flattening the dictionary passed to `BaseRemoteApp`.

#### 2: In `test_app`:

The connections used in the `profile` view were not defined, causing the tests to fail.