Skip to content

Commit

Permalink
The exercise and translation overview endpoints are not cached
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Feb 2, 2025
1 parent d6d841d commit 2c47fa4
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions wger/exercises/tests/test_exercise_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
import json

# Django
from django.template import (
Context,
Template,
)
from django.urls import reverse

# Third Party
Expand All @@ -32,6 +28,7 @@
from wger.exercises.models import (
Muscle,
Translation,
Exercise,
)
from wger.utils.constants import CC_BY_SA_4_ID

Expand Down Expand Up @@ -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,
Expand All @@ -140,7 +154,7 @@ def get_resource_name(self):
return 'exerciseinfo'


class ExerciseCustomApiTestCase(ExerciseCrudApiTestCase):
class ExerciseTranslationCustomApiTestCase(ExerciseCrudApiTestCase):
pk = 1

data = {
Expand Down

0 comments on commit 2c47fa4

Please sign in to comment.