tests: adapt to django-webtest 1.9.1 change in signatures
This commit is contained in:
parent
481c92b5f3
commit
a98fc4c09a
|
@ -65,13 +65,13 @@ def test_get_newsletters(app, categories, announces, user):
|
|||
def test_get_subscriptions_by_email(app, categories, announces, user):
|
||||
resp = app.get(reverse('subscriptions'), status=403)
|
||||
foo = 'foo@example.com'
|
||||
resp = app.get(reverse('subscriptions'), {'email': foo}, status=403)
|
||||
resp = app.get(reverse('subscriptions'), params={'email': foo}, status=403)
|
||||
app.authorization = ('Basic', ('john.doe', 'password'))
|
||||
for identifier, name in channel_choices[:1]:
|
||||
for category in categories:
|
||||
uri = '%s:%s' % (identifier, foo)
|
||||
Subscription.objects.create(identifier=uri, category=category)
|
||||
resp = app.get(reverse('subscriptions'), {'email': foo})
|
||||
resp = app.get(reverse('subscriptions'), params={'email': foo})
|
||||
assert 'data' in resp.json
|
||||
data = resp.json['data']
|
||||
for d in data:
|
||||
|
@ -94,7 +94,7 @@ def test_update_subscriptions(app, categories, announces, user):
|
|||
subscriptions = [{'id': category_id,
|
||||
'text': category.name,
|
||||
'transports': transports}]
|
||||
resp = app.post_json(subscriptions_url, subscriptions)
|
||||
resp = app.post_json(subscriptions_url, params=subscriptions)
|
||||
if resp.json['data']:
|
||||
resp = app.get(subscriptions_url)
|
||||
|
||||
|
@ -120,12 +120,12 @@ def test_simple_subscription(app, categories, user):
|
|||
url = '/api/subscribe/?email=john@example.net'
|
||||
|
||||
# anonymous
|
||||
resp = app.post_json(url, payload, status=403)
|
||||
resp = app.post_json(url, params=payload, status=403)
|
||||
assert resp.json['detail'] == 'Authentication credentials were not provided.'
|
||||
|
||||
# authenticated
|
||||
app.authorization = ('Basic', ('john.doe', 'password'))
|
||||
resp = app.post_json(url, payload, status=200)
|
||||
resp = app.post_json(url, params=payload, status=200)
|
||||
assert resp.json['data'] is True
|
||||
|
||||
# with wrong method
|
||||
|
|
Reference in New Issue