From 0dbc6533643615214ab66a0f77b06e27116a1fcd Mon Sep 17 00:00:00 2001 From: MateusVrs Date: Tue, 7 Nov 2023 10:46:05 -0300 Subject: [PATCH] =?UTF-8?q?api(urls):=20refatora=20a=20adi=C3=A7=C3=A3o=20?= =?UTF-8?q?de=20rota=20p/tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/core/urls.py | 7 ++++++- api/utils/urls.py | 10 +++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/api/core/urls.py b/api/core/urls.py index 74ae062b..671b882b 100644 --- a/api/core/urls.py +++ b/api/core/urls.py @@ -16,9 +16,14 @@ """ from django.contrib import admin from django.urls import path, include +import sys urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('users.urls')), - path('mock/', include('utils.urls')), ] + +if 'test' in sys.argv: + urlpatterns += [ + path('utils/', include('utils.urls')) + ] diff --git a/api/utils/urls.py b/api/utils/urls.py index 739af5f4..9b39a557 100644 --- a/api/utils/urls.py +++ b/api/utils/urls.py @@ -1,12 +1,8 @@ from django.urls import path from .views import mocked_departments -import sys app_name = 'utils' -urlpatterns = [] - -if 'test' in sys.argv: - urlpatterns += [ - path('departments/', mocked_departments, name='departments'), - ] +urlpatterns = [ + path('mock/departments/', mocked_departments, name='departments'), +]