Skip to content

Commit

Permalink
api(urls): refatora a adição de rota p/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusvrs committed Nov 7, 2023
1 parent db217bc commit 0dbc653
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 6 additions & 1 deletion api/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
]
10 changes: 3 additions & 7 deletions api/utils/urls.py
Original file line number Diff line number Diff line change
@@ -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'),
]

0 comments on commit 0dbc653

Please sign in to comment.