diff --git a/backend/tests/test_special_value_workout.py b/backend/tests/test_special_value_workout.py new file mode 100644 index 0000000..9c09b45 --- /dev/null +++ b/backend/tests/test_special_value_workout.py @@ -0,0 +1,33 @@ +""" +TC_005 - Special value test for the limit of sets in an exercise instance +""" +def test_create_valid_workout(self): + response = self.client.post("/api/workouts/", { + "name": "Full body toning", + "date": now().isoformat(), + "notes": "Workout for women", + "visibility": "PU", + "owner": self.user.id, + "exercise_instances": [] + }, format="json") + + print(f"Response data: {response.data}") + print(f"Response status code: {response.status_code}") + + assert response.status_code == 201 + assert Workout.objects.count() == 1 + +def test_create_invalid_workout(self): + response = self.client.post("/api/workouts/", { + "name": "Full body toning", + "date": "today", # text instead of a date format + "notes": "Workout for women", + "visibility": "XO", # non-existent visibility + "owner": self.user.id, + "exercise_instances": [] + }, format="json") + + print(f"Error response data: {response.data}") + print(f"Error response status code: {response.status_code}") + + assert response.status_code == 400