forked from mathialm/secfit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create test_special_value_workout.py
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |