Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fixed candidate select\deselect API test
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhiy-Shekhovtsov committed Dec 5, 2017
1 parent a8cfec5 commit 74e430a
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions interface/backend/api/tests.py
@@ -1,14 +1,17 @@
from backend.api.serializers import NoduleSerializer
from backend.cases.factories import (
CaseFactory,
NoduleFactory
NoduleFactory,
CandidateFactory
)
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase

from backend.cases import enums

class ViewTest(TestCase):
class ViewTest(APITestCase):
def test_nodule_list_viewset(self):
# first try an endpoint without a nodule
url = reverse('nodule-list')
Expand Down Expand Up @@ -40,3 +43,20 @@ def test_images_metadata_view(self):
'1.3.6.1.4.1.14519.5.2.1.6279.6001.619372068417051974713149104919/-80.750000.dcm'
})
self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_candidates_mark(self):
candidate = CandidateFactory()

url = reverse('candidate-detail', kwargs={'pk': candidate.id})
response = self.client.patch(url, {'review_result': enums.CandidateReviewResult.MARKED.value})

self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_candidates_dismiss(self):
candidate = CandidateFactory()

url = reverse('candidate-detail', kwargs={'pk': candidate.id})
response = self.client.patch(url, {'review_result': enums.CandidateReviewResult.DISMISSED.value})

self.assertEqual(response.status_code, status.HTTP_200_OK)

0 comments on commit 74e430a

Please sign in to comment.