Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

self review changes

Tom Bowyer65277924f1f4
diff --git a/wger/core/tests/api_base_test.py b/wger/core/tests/api_base_test.py
index bf06a9651..a4f900b8c 100644
--- a/wger/core/tests/api_base_test.py
+++ b/wger/core/tests/api_base_test.py
@@ -292,11 +292,15 @@ class ApiPostTestCase(object):
# Different logged in user
self.get_credentials(self.user_fail)
- response = self.client.post(self.url_detail, data=self.data)
- self.assertIn(
- response.status_code,
- (status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_403_FORBIDDEN)
- )
+ response = self.client.post(self.url, data=self.data)
+ if self.protected_resource:
+ self.assertIn(response.status_code,
+ (status.HTTP_200_OK, status.HTTP_201_CREATED))
+ else:
+ self.assertIn(
+ response.status_code,
+ (status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_403_FORBIDDEN)
+ )
def test_post_special_endpoints(self):
"""
@@ -370,7 +374,7 @@ class ApiPatchTestCase(object):
(status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_403_FORBIDDEN)
)
- # Different logged in user. Usually admin.
+ # Different logged in user
self.get_credentials(self.user_fail)
response = self.client.patch(self.url_detail, data=self.data)
if self.protected_resource:
@@ -497,7 +501,7 @@ class ApiPutTestCase(object):
(status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_403_FORBIDDEN)
)
- # Different logged in user. Usually admin.
+ # Different logged in user
self.get_credentials(self.user_fail)
response = self.client.put(self.url_detail, data=self.data)
if self.protected_resource:
diff --git a/wger/exercises/management/commands/change-exercise-author.py b/wger/exercises/management/commands/change-exercise-author.py
index 73b4ff359..e0819e31e 100644
--- a/wger/exercises/management/commands/change-exercise-author.py
+++ b/wger/exercises/management/commands/change-exercise-author.py
@@ -32,7 +32,7 @@ class Command(BaseCommand):
'Must provide at least the exercise base id using --exercise-base-id\n'
'or the exercise id using --exercise-id.\n'
'Must also provide the new author name using --author-name\n'
- )
+ )
def add_arguments(self, parser):
parser.add_argument(
@@ -45,7 +45,7 @@ class Command(BaseCommand):
'--exercise-base-id',
action='store',
dest='exercise_base_id',
- help='The ID of the exercise'
+ help='The ID of the exercise base'
)
parser.add_argument(
'--exercise-id',