Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fixed #47

Merged
merged 4 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ import os
BASE_DIR = './'
# Used internally by Django, can be anything of your choice
SECRET_KEY = '<random string>'
# API hostname, e.g. https://api.openbankproject.com
# API hostname, e.g. https://api.openbankproject.com
# API OBP URL
API_HOST = 'http://127.0.0.1:8080'
# Consumer key + secret to authenticate the _app_ against the API
OAUTH_CONSUMER_KEY = '<key>'
Expand Down
29 changes: 29 additions & 0 deletions apitester/apitester/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,37 @@

from base.views import HomeView

from obp.views import OAuthInitiateView, OAuthAuthorizeView, DirectLoginView, GatewayLoginView, LogoutView

from django.conf import settings
import logging

LOGGER = logging.getLogger(__name__)

def LogAtStart():
LOGGER.log(logging.INFO, 'OAUTH_BASE_URL: {}'.format(
settings.OAUTH_BASE_URL))

LOGGER.log(logging.INFO, 'API_HOST: {}'.format(
settings.API_HOST))

LOGGER.log(logging.INFO, 'API_ROOT: {}'.format(
settings.API_ROOT))

LogAtStart()

urlpatterns = [
url(r'^$', HomeView.as_view(), name="home"),
url(r'^oauth/initiate$',
OAuthInitiateView.as_view(), name='oauth-initiate'),
url(r'^oauth/authorize$',
OAuthAuthorizeView.as_view(), name='oauth-authorize'),
url(r'^directlogin$',
DirectLoginView.as_view(), name='directlogin'),
url(r'^gatewaylogin$',
GatewayLoginView.as_view(), name='gatewaylogin'),
url(r'^logout$',
LogoutView.as_view(), name='oauth-logout'),
url(r'^obp/', include('obp.urls')),
url(r'^runtests/', include('runtests.urls')),
]
27 changes: 5 additions & 22 deletions apitester/obp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,15 @@
LogoutView,
)

from django.conf import settings
import logging

LOGGER = logging.getLogger(__name__)

def LogAtStart():
LOGGER.log(logging.INFO, 'OAUTH_BASE_URL: {}'.format(
settings.OAUTH_BASE_URL))

LOGGER.log(logging.INFO, 'API_HOST: {}'.format(
settings.API_HOST))

LOGGER.log(logging.INFO, 'API_ROOT: {}'.format(
settings.API_ROOT))

LogAtStart()

urlpatterns = [
url(r'^oauth/initiate$',
OAuthInitiateView.as_view(), name='oauth-initiate'),
OAuthInitiateView.as_view(), name='obp-oauth-initiate'),
url(r'^oauth/authorize$',
OAuthAuthorizeView.as_view(), name='oauth-authorize'),
OAuthAuthorizeView.as_view(), name='obp-oauth-authorize'),
url(r'^directlogin$',
DirectLoginView.as_view(), name='directlogin'),
DirectLoginView.as_view(), name='obp-directlogin'),
url(r'^gatewaylogin$',
GatewayLoginView.as_view(), name='gatewaylogin'),
GatewayLoginView.as_view(), name='obp-gatewaylogin'),
url(r'^logout$',
LogoutView.as_view(), name='oauth-logout'),
LogoutView.as_view(), name='obp-oauth-logout'),
]
2 changes: 1 addition & 1 deletion apitester/runtests/static/runtests/js/runtests.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ $(function() {
'remark':remark,
'csrfmiddlewaretoken': window.CSRF
}, function (response) {
$(item_list).clone().appendTo($(item_list));
$(item_list).clone(true).insertAfter($(item_list));
});
});

Expand Down
8 changes: 4 additions & 4 deletions apitester/runtests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,20 @@ def get_config(self, testmethod, testpath, testconfig_pk, operation_id):
status_code = 204

try:
obj = ProfileOperation.objects.get(
profile_id=testconfig_pk,
objs = ProfileOperation.objects.filter(
profile_id=int(testconfig_pk),
operation_id=operation_id,
is_deleted=0
)
except ProfileOperation.DoesNotExist:
obj = None
objs = None

config = {
'found': True,
'method': testmethod,
'status_code': status_code,
'summary': 'Unknown',
'urlpath': urlpath if obj is None else obj.urlpath,
'urlpath': urlpath if objs is None or len(objs)==0 else objs[0].urlpath,
'operation_id': operation_id,
'profile_id': testconfig_pk,
'payload': self.request.POST.get('json_body')
Expand Down