From 977ce8ca8b338dd3e7fae696abfcf1ff11aa64ff Mon Sep 17 00:00:00 2001 From: Oliver Marks Date: Mon, 20 Feb 2017 20:16:12 +0000 Subject: [PATCH] made the return url in the tests more complete, and pass through get params to subscription confirm --- .drone.yml | 2 ++ mhackspace/subscriptions/tests/test_views.py | 8 ++++++-- mhackspace/subscriptions/views.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6f71407..f4326f6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,6 +18,7 @@ pipeline: - python manage.py test mhackspace --verbosity 2 publish-test: + pull: True image: appleboy/drone-ssh host: maidstone-hackspace.org.uk user: ${SSH_USERNAME} @@ -27,6 +28,7 @@ pipeline: - echo 'to be added' publish-live: + pull: True image: appleboy/drone-ssh user: ${SSH_USERNAME} key: ${SSH_KEY} diff --git a/mhackspace/subscriptions/tests/test_views.py b/mhackspace/subscriptions/tests/test_views.py index d0d89fb..e611d96 100644 --- a/mhackspace/subscriptions/tests/test_views.py +++ b/mhackspace/subscriptions/tests/test_views.py @@ -37,8 +37,12 @@ class TestSubscriptionSuccessRedirectView(BaseUserTestCase): } request = self.factory.post( - reverse('join_hackspace_success', kwargs={'provider': 'gocardless'}), - {'signature': 'test_signature'} + reverse('join_hackspace_success', kwargs={'provider': 'gocardless'}), { + 'resource_id': 'R01', + 'resource_type': 'subscription', + 'resource_url': 'https://sandbox.gocardless.com', + 'signature': 'test_signature' + } ) setattr(request, 'session', 'session') diff --git a/mhackspace/subscriptions/views.py b/mhackspace/subscriptions/views.py index 26c2476..d2b1bba 100644 --- a/mhackspace/subscriptions/views.py +++ b/mhackspace/subscriptions/views.py @@ -82,7 +82,7 @@ class MembershipJoinSuccessView(LoginRequiredMixin, RedirectView): payment_provider = 'gocardless' provider = select_provider(payment_provider) result = provider.confirm_subscription( - provider_response=kwargs + provider_response=self.request.GET ) #if something went wrong return to profile with an error