Fakultas Ilmu Komputer UI

Commit 1dc7b601 authored by Glenda Emanuella Sutanto's avatar Glenda Emanuella Sutanto
Browse files

[REFACTOR] Shorten long variable name

parent f3d3eeba
Pipeline #72700 passed with stage
in 6 minutes and 21 seconds
......@@ -197,7 +197,7 @@ class UserModelTests(APITestCase):
'cart_id': self.cart.id,
}
response = self.client.post('/auth/link-user-and-diet-profile-and-cart/', data, format='json')
response = self.client.post('/auth/link-data/', data, format='json')
self.assertEqual(json.loads(response.content).get('user').get('email'), \
self.custom_user_2.email)
self.assertEqual(json.loads(response.content).get('diet_profile').get('id'), \
......@@ -212,7 +212,7 @@ class UserModelTests(APITestCase):
'cart_id': self.cart.id,
}
response = self.client.post('/auth/link-user-and-diet-profile-and-cart/', data, format='json')
response = self.client.post('/auth/link-data/', data, format='json')
self.assertEqual(json.loads(response.content).get('message'), 'User is not found.')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
......@@ -223,7 +223,7 @@ class UserModelTests(APITestCase):
'cart_id': self.cart.id,
}
response = self.client.post('/auth/link-user-and-diet-profile-and-cart/', data, format='json')
response = self.client.post('/auth/link-data/', data, format='json')
self.assertEqual(json.loads(response.content).get('message'), 'Diet profile is not found.')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
......@@ -234,7 +234,7 @@ class UserModelTests(APITestCase):
'cart_id': -1,
}
response = self.client.post('/auth/link-user-and-diet-profile-and-cart/', data, format='json')
response = self.client.post('/auth/link-data/', data, format='json')
self.assertEqual(json.loads(response.content).get('message'), 'Cart is not found.')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
......
from rest_framework import routers
from django.urls import path, include
from .views import LinkUserAndDietProfileAndCartViewSet, GoogleView, CustomLoginView
from .views import LinkDataViewSet, GoogleView, CustomLoginView
router = routers.SimpleRouter()
router.register('auth/link-user-and-diet-profile-and-cart', LinkUserAndDietProfileAndCartViewSet, \
basename="LinkUserAndDietProfileAndCart")
router.register('auth/link-data', LinkDataViewSet, \
basename="LinkData")
urlpatterns = [
path('auth/registration/', include('dj_rest_auth.registration.urls')),
......
......@@ -17,7 +17,7 @@ class CustomLoginView(LoginView):
serializer_class = CustomLoginSerializer
class LinkUserAndDietProfileAndCartViewSet(viewsets.ViewSet):
class LinkDataViewSet(viewsets.ViewSet):
@staticmethod
def create(request):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment