Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

The exercise and translation overview endpoints are not cached

Roland Geider2c47fa4d7361
diff --git a/wger/exercises/tests/test_exercise_translation.py b/wger/exercises/tests/test_exercise_translation.py
index 5edb91504..21ee69873 100644
--- a/wger/exercises/tests/test_exercise_translation.py
+++ b/wger/exercises/tests/test_exercise_translation.py
@@ -16,10 +16,6 @@
import json
# Django
-from django.template import (
- Context,
- Template,
-)
from django.urls import reverse
# Third Party
@@ -32,6 +28,7 @@ from wger.core.tests.base_testcase import WgerTestCase
from wger.exercises.models import (
Muscle,
Translation,
+ Exercise,
)
from wger.utils.constants import CC_BY_SA_4_ID
@@ -115,14 +112,31 @@ class ExerciseApiTestCase(
"""
pk = 1
- resource = Translation
+ resource = Exercise
private_resource = False
- overview_cached = True
+ overview_cached = False
def get_resource_name(self):
return 'exercise'
+# TODO: fix test, all registered users can upload exercises
+class ExerciseTranslationApiTestCase(
+ api_base_test.BaseTestCase, api_base_test.ApiBaseTestCase, api_base_test.ApiGetTestCase
+):
+ """
+ Tests the exercise overview resource
+ """
+
+ pk = 1
+ resource = Translation
+ private_resource = False
+ overview_cached = False
+
+ def get_resource_name(self):
+ return 'exercise-translation'
+
+
class ExerciseInfoApiTestCase(
api_base_test.BaseTestCase,
api_base_test.ApiBaseTestCase,
@@ -140,7 +154,7 @@ class ExerciseInfoApiTestCase(
return 'exerciseinfo'
-class ExerciseCustomApiTestCase(ExerciseCrudApiTestCase):
+class ExerciseTranslationCustomApiTestCase(ExerciseCrudApiTestCase):
pk = 1
data = {