Skip to content
Snippets Groups Projects
Commit e2cf5bb3 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Testcase for #94

parent 2b7d27d3
No related branches found
No related tags found
1 merge request!49Bug assignment for same submission
Pipeline #
...@@ -254,6 +254,33 @@ class TestApiEndpoints(APITestCase): ...@@ -254,6 +254,33 @@ class TestApiEndpoints(APITestCase):
assignments = response.data['assignments'] assignments = response.data['assignments']
self.assertEqual(2, len(assignments)) self.assertEqual(2, len(assignments))
def test_two_tutors_cant_have_assignments_for_same_submission(self):
client = APIClient()
client.force_authenticate(user=self.data['tutors'][0])
subscription = client.post('/api/subscription/',
{'query_type': 'random'}).data
assignment_fst_tutor = client.post(
'/api/assignment/', {
'subscription': subscription['pk']
}
).data
client.force_authenticate(user=self.data['tutors'][1])
subscription = client.post('/api/subscription/',
{'query_type': 'random'}).data
assignment_snd_tutor = client.post(
'/api/assignment/', {
'subscription': subscription['pk']
}
).data
self.assertNotEqual(assignment_fst_tutor['submission']['pk'],
assignment_snd_tutor['submission']['pk'])
def test_all_stages_of_the_subscription(self): def test_all_stages_of_the_subscription(self):
client = APIClient() client = APIClient()
client.force_authenticate(user=self.data['tutors'][0]) client.force_authenticate(user=self.data['tutors'][0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment