diff --git a/backend/tests/TestExerciseSet.py b/backend/tests/TestExerciseSet.py index fa84b0c..abf883e 100644 --- a/backend/tests/TestExerciseSet.py +++ b/backend/tests/TestExerciseSet.py @@ -13,7 +13,7 @@ def setUp(self): self.user = get_user_model().objects.create_user(username="testuser", password="password") self.client.force_authenticate(self.user) - def test_create_workout_valid(self): # + def test_exercise_set_min_minus(self): # response = self.client.post("/api/workouts/", { "name": "Morning Run", "date": now().isoformat(), @@ -27,7 +27,43 @@ def test_create_workout_valid(self): # assert response.status_code == 201 assert Workout.objects.count() == 1 - def test_create_workout_invalid_date(self): # + def test_exercise_set_min_plus(self): # + response = self.client.post("/api/workouts/", { + "name": "Invalid Run", + "date": "invalid_date", + "notes": "Wrong format", + "visibility": "PU", # Adding required field + "owner": self.user.id, # Adding required field + "exercise_instances": [] # Adding required field + }, format="json") + + assert response.status_code == 400 # Should return validation error + + def test_exercise_set_nom(self): # + response = self.client.post("/api/workouts/", { + "name": "Invalid Run", + "date": "invalid_date", + "notes": "Wrong format", + "visibility": "PU", # Adding required field + "owner": self.user.id, # Adding required field + "exercise_instances": [] # Adding required field + }, format="json") + + assert response.status_code == 400 # Should return validation error + + def test_exercise_set_max_minus(self): # + response = self.client.post("/api/workouts/", { + "name": "Invalid Run", + "date": "invalid_date", + "notes": "Wrong format", + "visibility": "PU", # Adding required field + "owner": self.user.id, # Adding required field + "exercise_instances": [] # Adding required field + }, format="json") + + assert response.status_code == 400 # Should return validation error + + def test_exercise_set_max_plus(self): # response = self.client.post("/api/workouts/", { "name": "Invalid Run", "date": "invalid_date",