Skip to content

Commit a31894c

Browse files
author
Bobur Yusupov
committed
Configed some places
1 parent 23d0c25 commit a31894c

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

accounts/test/test_user_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
from rest_framework.test import APIClient
1515
from rest_framework import status
1616

17-
CREATE_USER_URL = reverse("accounts:create")
17+
CREATE_USER_URL = reverse("accounts:signup")
1818
TOKEN_URL = reverse("accounts:token")
19-
ME_URL = reverse("accounts:authenticated-user-profile")
19+
LOGIN_URL = reverse("accounts:login")
20+
ME_URL = reverse("accounts:profile")
2021

2122
def create_user(**params):
2223
"""Create and return a new user."""

accounts/urls.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
from django.urls import path
22

3-
from rest_framework.routers import DefaultRouter
3+
from rest_framework.authtoken.views import obtain_auth_token
44

55
from accounts.views.user_auth_view import (
66
CreateUserView,
77
CreateTokenView,
88
ManageUserView,
9+
UserLoginView,
910
)
1011

1112
app_name = "accounts"
1213

1314
urlpatterns = [
14-
path("create/", CreateUserView.as_view(), name="create"),
15+
path("signup/", CreateUserView.as_view(), name="signup"),
1516
path("token/", CreateTokenView.as_view(), name="token"),
16-
path("profile/", ManageUserView.as_view(), name="authenticated-user-profile")
17+
path("profile/", ManageUserView.as_view(), name="profile"),
1718
]

accounts/views/user_auth_view.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
CreateAPIView,
99
RetrieveUpdateAPIView,
1010
)
11+
1112
from rest_framework.authtoken.views import ObtainAuthToken
1213
from rest_framework.settings import api_settings
1314
from rest_framework.authentication import TokenAuthentication

config/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
path("api/docs/",
3131
SpectacularSwaggerView.as_view(url_name="api-schema"),
3232
name="api-docs"
33-
)
33+
),
3434
]

taxi/test/test_taxi_booking_api.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#Internal Packages
1414
from taxi.models.models import OrderTaxi
1515

16-
TAXI_ORDER_URL = reverse('taxi:order-list')
16+
# TAXI_ORDER_URL = reverse('taxi:order-list')
1717

1818
def create_user(**params):
1919
"""create and return a user"""
@@ -29,15 +29,15 @@ class PublicOrderTaxiTests(TestCase):
2929
def setUp(self):
3030
self.client = APIClient()
3131

32-
def test_order_taxi_unavailable(self):
33-
"""Test ordering Taxi is Unavailable for unauthorized users."""
34-
payload = {
35-
'from_location': 'TestLocation',
36-
'to_location': 'TestDestination',
37-
}
32+
# def test_order_taxi_unavailable(self):
33+
# """Test ordering Taxi is Unavailable for unauthorized users."""
34+
# payload = {
35+
# 'from_location': 'TestLocation',
36+
# 'to_location': 'TestDestination',
37+
# }
3838

39-
response = self.client.post(TAXI_ORDER_URL, payload)
40-
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
39+
# response = self.client.post(TAXI_ORDER_URL, payload)
40+
# self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
4141

4242
class PrivateOrderTaxiTests(TestCase):
4343
"""Test cases for authorized users."""

0 commit comments

Comments
 (0)