From 8ea40eca2442e33cfe94a8094e5b3349de193f5e Mon Sep 17 00:00:00 2001 From: "robinwilliam.hundt" <robinwilliam.hundt@stud.uni-goettingen.de> Date: Tue, 20 Feb 2018 22:53:19 +0100 Subject: [PATCH] Fixed randomly failing subscription test The issue was that ```python response = client.post( f'/api/feedback/', { "score": 23, "of_submission": response.data['submission']['pk'], "feedback_lines": { 2: {"text": "< some string >"}, 3: {"text": "< some string >"} } } ) self.assertEqual(status.HTTP_201_CREATED, response.status_code) ``` would sometimes get the one submission that only had 2 lines (since submission distribution hasn't been randomized for long, this issue didn't come up earlier) and thus fail as it should. I changed the commented line to 1 and 2 in the POST. This should fix the issue. --- core/tests/test_subscription_assignment_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tests/test_subscription_assignment_service.py b/core/tests/test_subscription_assignment_service.py index d23a8ba7..55652250 100644 --- a/core/tests/test_subscription_assignment_service.py +++ b/core/tests/test_subscription_assignment_service.py @@ -315,8 +315,8 @@ class TestApiEndpoints(APITestCase): "score": 23, "of_submission": response.data['submission']['pk'], "feedback_lines": { - 2: {"text": "< some string >"}, - 3: {"text": "< some string >"} + 1: {"text": "< some string >"}, + 2: {"text": "< some string >"} } } ) -- GitLab