Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Small updates to the test suite

Roland Geiderfdabe214dfad
diff --git a/wger/exercises/fixtures/test-exercises.json b/wger/exercises/fixtures/test-exercises.json
index 2d7e9d6dd..25ab856e9 100644
--- a/wger/exercises/fixtures/test-exercises.json
+++ b/wger/exercises/fixtures/test-exercises.json
@@ -104,7 +104,7 @@
],
"description": "",
"user": null,
- "name": "A very cool exercise"
+ "name": "Very cool exercise"
}
},
{
diff --git a/wger/exercises/tests/exercise.py b/wger/exercises/tests/exercise.py
index b7d5eab83..736f8462c 100644
--- a/wger/exercises/tests/exercise.py
+++ b/wger/exercises/tests/exercise.py
@@ -52,11 +52,11 @@ class ExerciseIndexTestCase(WorkoutManagerTestCase):
exercises_1 = category_1.exercise_set.all()
exercise_1 = exercises_1[0]
exercise_2 = exercises_1[1]
- self.assertEqual(exercise_1.id, 2)
- self.assertEqual(exercise_1.name, "A very cool exercise")
+ self.assertEqual(exercise_1.id, 1)
+ self.assertEqual(exercise_1.name, "An exercise")
- self.assertEqual(exercise_2.id, 1)
- self.assertEqual(exercise_2.name, "An exercise")
+ self.assertEqual(exercise_2.id, 2)
+ self.assertEqual(exercise_2.name, "Very cool exercise")
# Only authorized users see the edit links
if admin:
@@ -317,12 +317,12 @@ class ExercisesTestCase(WorkoutManagerTestCase):
Helper function to test searching for exercises
'''
- # Search for exercises (1 hit, "A very cool exercise")
+ # Search for exercises (1 hit, "Very cool exercise")
response = self.client.get(reverse('wger.exercises.views.exercises.search'),
{'term': 'cool'})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context['exercises']), 1)
- self.assertEqual(response.context['exercises'][0].name, 'A very cool exercise')
+ self.assertEqual(response.context['exercises'][0].name, 'Very cool exercise')
# Search for a pending exercise (0 hits, "Pending exercise")
response = self.client.get(reverse('wger.exercises.views.exercises.search'),
@@ -332,14 +332,14 @@ class ExercisesTestCase(WorkoutManagerTestCase):
kwargs = {'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest'}
- # AJAX-Search for exercises (1 hit, "A very cool exercise")
+ # AJAX-Search for exercises (1 hit, "Very cool exercise")
response = self.client.get(reverse('wger.exercises.views.exercises.search'),
{'term': 'cool'},
**kwargs)
self.assertEqual(response.status_code, 200)
result = json.loads(response.content)
self.assertEqual(len(result), 1)
- self.assertEqual(result[0]['value'], 'A very cool exercise')
+ self.assertEqual(result[0]['value'], 'Very cool exercise')
# AJAX Search for a pending exercise (0 hits, "Pending exercise")
response = self.client.get(reverse('wger.exercises.views.exercises.search'),
diff --git a/wger/manager/fixtures/test-user-data.json b/wger/manager/fixtures/test-user-data.json
index 18f8c6a65..6d178e7c1 100644
--- a/wger/manager/fixtures/test-user-data.json
+++ b/wger/manager/fixtures/test-user-data.json
@@ -13,10 +13,7 @@
68,
63,
66,
- 69,
- 88,
- 89,
- 90
+ 69
]
}
},
diff --git a/wger/nutrition/fixtures/test-ingredients.json b/wger/nutrition/fixtures/test-ingredients.json
index 488c613e3..90f0593d8 100644
--- a/wger/nutrition/fixtures/test-ingredients.json
+++ b/wger/nutrition/fixtures/test-ingredients.json
@@ -16,7 +16,7 @@
"fat_saturated": "3.244",
"fibres": "0.0",
"protein": "25.63",
- "carbohydrates": "0.0"
+ "carbohydrates": "0.1251"
}
},
{
@@ -36,7 +36,7 @@
"fat_saturated": "3",
"fibres": "5.0",
"protein": "25.63",
- "carbohydrates": "0.0"
+ "carbohydrates": "0.1251"
}
},
{
@@ -56,7 +56,7 @@
"fat_saturated": "3",
"fibres": "5.0",
"protein": "25.63",
- "carbohydrates": "0.0"
+ "carbohydrates": "0.1551"
}
},
{
diff --git a/wger/nutrition/tests/ingredient.py b/wger/nutrition/tests/ingredient.py
index fc64f3e8e..ab763bdfa 100644
--- a/wger/nutrition/tests/ingredient.py
+++ b/wger/nutrition/tests/ingredient.py
@@ -281,7 +281,7 @@ class IngredientValuesTestCase(WorkoutManagerTestCase):
u'fat_saturated': u'0.03244',
u'fibres': 0,
u'protein': u'0.2563',
- u'carbohydrates': u'0'})
+ u'carbohydrates': u'0.00125'})
# Get the nutritional values in 1 unit of product
response = self.client.post(reverse('ingredient-get-values', kwargs={'pk': 1}),
@@ -299,7 +299,7 @@ class IngredientValuesTestCase(WorkoutManagerTestCase):
u'fat_saturated': u'3.61706',
u'fibres': 0,
u'protein': u'28.57745',
- u'carbohydrates': u'0.0'})
+ u'carbohydrates': u'0.139375'})
def test_calculate_value_anonymous(self):
'''