From aa037d27f563ecc23e46f398a88f590485f56b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 27 Sep 2019 10:41:41 +0300 Subject: [PATCH 1/4] Double api --- apps/search_indexes/urls.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/search_indexes/urls.py b/apps/search_indexes/urls.py index 664e0b99..8e914719 100644 --- a/apps/search_indexes/urls.py +++ b/apps/search_indexes/urls.py @@ -6,5 +6,6 @@ from search_indexes import views router = routers.SimpleRouter() # router.register(r'news', views.NewsDocumentViewSet, basename='news') # temporarily disabled router.register(r'establishments', views.EstablishmentDocumentViewSet, basename='establishment') +router.register(r'mobile/establishments', views.EstablishmentDocumentViewSet, basename='establishment-mobile') urlpatterns = router.urls From d115d30e821e5413c7d9bb909ac013e977fcba5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 27 Sep 2019 11:19:49 +0300 Subject: [PATCH 2/4] Fix test authorization --- apps/authorization/tests/tests_authorization.py | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/authorization/tests/tests_authorization.py b/apps/authorization/tests/tests_authorization.py index 4a5d2a2b..d9fd7b71 100644 --- a/apps/authorization/tests/tests_authorization.py +++ b/apps/authorization/tests/tests_authorization.py @@ -22,7 +22,6 @@ def get_tokens_for_user( class AuthorizationTests(APITestCase): def setUp(self): - print("Auth!") data = get_tokens_for_user() self.username = data["username"] self.password = data["password"] From c7974a75115dae7b7662116d1918e20a66fed644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 27 Sep 2019 11:33:49 +0300 Subject: [PATCH 3/4] Refactor authorization test --- apps/authorization/tests/tests_authorization.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/authorization/tests/tests_authorization.py b/apps/authorization/tests/tests_authorization.py index d9fd7b71..6028e386 100644 --- a/apps/authorization/tests/tests_authorization.py +++ b/apps/authorization/tests/tests_authorization.py @@ -1,5 +1,6 @@ from rest_framework.test import APITestCase from account.models import User +from django.urls import reverse # Create your tests here. @@ -32,7 +33,9 @@ class AuthorizationTests(APITestCase): 'password': self.password, 'remember': True } - response = self.client.post('/api/auth/login/', data=data) + # login + # /api/auth/login/ + response = self.client.post(reverse('auth:authorization:login'), data=data) self.assertEqual(response.data['access_token'], self.tokens.get('access_token')) self.assertEqual(response.data['refresh_token'], self.tokens.get('refresh_token')) From fc5ec0920ec3aa5e409d0461cd5c6a109578c488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 27 Sep 2019 11:43:14 +0300 Subject: [PATCH 4/4] fix --- apps/authorization/tests/tests_authorization.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/authorization/tests/tests_authorization.py b/apps/authorization/tests/tests_authorization.py index 6028e386..a6a49ea5 100644 --- a/apps/authorization/tests/tests_authorization.py +++ b/apps/authorization/tests/tests_authorization.py @@ -33,8 +33,6 @@ class AuthorizationTests(APITestCase): 'password': self.password, 'remember': True } - # login - # /api/auth/login/ response = self.client.post(reverse('auth:authorization:login'), data=data) self.assertEqual(response.data['access_token'], self.tokens.get('access_token')) self.assertEqual(response.data['refresh_token'], self.tokens.get('refresh_token'))