Commit 864271ce authored by Bengfort's avatar Bengfort
Browse files

rm legacy views

parent 8b48ea8a
Pipeline #10760 passed with stages
in 1 minute and 59 seconds
......@@ -7,31 +7,6 @@ from .main.models import Schedule
from .main.models import Invitation
class TestLegacyInvitationApiView(TestCase):
def setUp(self):
self.client.defaults['HTTP_AUTHORIZATION'] = 'token ' + settings.API_TOKEN
def test_get(self):
invitation = baker.make(Invitation)
url = '/api/{}/{}/'.format(invitation.schedule.id, invitation.token)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_put(self):
schedule = baker.make(Schedule)
url = '/api/{}/{}/'.format(schedule.id, 'sometoken')
response = self.client.put(url)
self.assertEqual(response.status_code, 204)
self.assertTrue(Invitation.objects.filter(token='sometoken').exists())
def test_delete(self):
invitation = baker.make(Invitation)
url = '/api/{}/{}/'.format(invitation.schedule.id, invitation.token)
response = self.client.delete(url)
self.assertEqual(response.status_code, 204)
self.assertFalse(Invitation.objects.filter(token=invitation.token).exists())
class TestInvitationApiView(TestCase):
def setUp(self):
self.client.defaults['HTTP_AUTHORIZATION'] = 'token ' + settings.API_TOKEN
......
......@@ -35,25 +35,13 @@ from .main.views import ScheduleUpdateView
urlpatterns = [
path('', ScheduleListView.as_view(), name='index'),
path('new/', ScheduleCreateView.as_view(), name='schedule-create'),
path('<int:pk>/', ScheduleUpdateView.as_view(), name='schedule-update-legacy'),
path('<uuid:uuid>/', ScheduleUpdateView.as_view(), name='schedule-update'),
path('<int:pk>/delete/', ScheduleDeleteView.as_view(), name='schedule-delete-legacy'),
path('<uuid:uuid>/delete/', ScheduleDeleteView.as_view(), name='schedule-delete'),
path(
'invitations/<int:schedule_id>/<token>/',
InvitationUpdateView.as_view(),
name='invitation-legacy',
),
path(
'invitations/<uuid:schedule__uuid>/<token>/',
InvitationUpdateView.as_view(),
name='invitation',
),
path(
'api/<int:schedule_id>/<token>/',
InvitationApiView.as_view(),
name='api-invitation-legacy',
),
path(
'api/<uuid:schedule__uuid>/<token>/',
InvitationApiView.as_view(),
......
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