Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix group permission fixture

Roland Geider7ad796adc46e
diff --git a/extras/scripts/filter-fixtures.py b/extras/scripts/filter-fixtures.py
index 9feb4ff33..e92c9eb12 100644
--- a/extras/scripts/filter-fixtures.py
+++ b/extras/scripts/filter-fixtures.py
@@ -19,7 +19,7 @@ Simple script that filters the output of django's dumpdata command into more
manageable chunks.
Create the data.json e.g. with:
- python ../../manage.py dumpdata --indent=4 > data.json
+ python ../../manage.py dumpdata --indent 4 --natural > data.json
'''
import json
diff --git a/wger/core/fixtures/groups.json b/wger/core/fixtures/groups.json
index b4578dfa0..9205af37f 100644
--- a/wger/core/fixtures/groups.json
+++ b/wger/core/fixtures/groups.json
@@ -50,31 +50,16 @@
"core",
"gym"
],
- [
- "add_exercisecomment",
- "core",
- "language"
- ],
[
"add_language",
"core",
"language"
],
- [
- "change_exercisecomment",
- "core",
- "language"
- ],
[
"change_language",
"core",
"language"
],
- [
- "delete_exercisecomment",
- "core",
- "language"
- ],
[
"delete_language",
"core",
@@ -95,66 +80,21 @@
"core",
"license"
],
- [
- "add_exercisecategory",
- "core",
- "userprofile"
- ],
- [
- "change_exercisecategory",
- "core",
- "userprofile"
- ],
- [
- "delete_exercisecategory",
- "core",
- "userprofile"
- ],
- [
- "add_equipment",
- "easy_thumbnails",
- "thumbnail"
- ],
- [
- "change_equipment",
- "easy_thumbnails",
- "thumbnail"
- ],
- [
- "delete_equipment",
- "easy_thumbnails",
- "thumbnail"
- ],
[
"add_equipment",
"exercises",
"equipment"
],
- [
- "add_ingredient",
- "exercises",
- "equipment"
- ],
[
"change_equipment",
"exercises",
"equipment"
],
- [
- "change_ingredient",
- "exercises",
- "equipment"
- ],
[
"delete_equipment",
"exercises",
"equipment"
],
- [
- "delete_ingredient",
- "exercises",
- "equipment"
- ],
[
"add_exercise",
"exercises",
@@ -229,111 +169,83 @@
"delete_muscle",
"exercises",
"muscle"
- ],
- [
- "add_language",
- "manager",
- "setting"
- ],
- [
- "change_language",
- "manager",
- "setting"
- ],
- [
- "delete_language",
- "manager",
- "setting"
- ],
- [
- "add_daysofweek",
- "manager",
- "workout"
- ],
- [
- "change_daysofweek",
- "manager",
- "workout"
- ],
- [
- "delete_daysofweek",
- "manager",
- "workout"
- ],
- [
- "add_muscle",
- "manager",
- "workoutlog"
- ],
- [
- "change_muscle",
- "manager",
- "workoutlog"
- ],
- [
- "delete_muscle",
- "manager",
- "workoutlog"
- ],
- [
- "add_ingredientweightunit",
- "nutrition",
- "ingredient"
- ],
- [
- "change_ingredientweightunit",
- "nutrition",
- "ingredient"
- ],
+ ]
+ ]
+ }
+ },
+ {
+ "pk": 2,
+ "model": "auth.group",
+ "fields": {
+ "name": "general_gym_manager",
+ "permissions": [
[
- "delete_ingredientweightunit",
- "nutrition",
- "ingredient"
+ "add_gymconfig",
+ "config",
+ "gymconfig"
],
[
- "add_languageconfig",
- "nutrition",
- "mealitem"
+ "change_gymconfig",
+ "config",
+ "gymconfig"
],
[
- "change_languageconfig",
- "nutrition",
- "mealitem"
+ "delete_gymconfig",
+ "config",
+ "gymconfig"
],
[
- "delete_languageconfig",
- "nutrition",
- "mealitem"
+ "add_gym",
+ "core",
+ "gym"
],
[
- "add_exerciseimage",
- "tastypie",
- "apiaccess"
+ "change_gym",
+ "core",
+ "gym"
],
[
- "change_exerciseimage",
- "tastypie",
- "apiaccess"
+ "delete_gym",
+ "core",
+ "gym"
],
[
- "delete_exerciseimage",
- "tastypie",
- "apiaccess"
- ],
+ "manage_gyms",
+ "core",
+ "gym"
+ ]
+ ]
+ }
+ },
+ {
+ "pk": 3,
+ "model": "auth.group",
+ "fields": {
+ "name": "gym_manager",
+ "permissions": [
[
- "add_exercise",
- "weight",
- "weightentry"
+ "change_gym",
+ "core",
+ "gym"
],
[
- "change_exercise",
- "weight",
- "weightentry"
- ],
+ "manage_gym",
+ "core",
+ "gym"
+ ]
+ ]
+ }
+ },
+ {
+ "pk": 4,
+ "model": "auth.group",
+ "fields": {
+ "name": "gym_trainer",
+ "permissions": [
[
- "delete_exercise",
- "weight",
- "weightentry"
+ "gym_trainer",
+ "core",
+ "gym"
]
]
}
diff --git a/wger/manager/tests/testcase.py b/wger/manager/tests/testcase.py
index b0d0ec69b..1668ff012 100644
--- a/wger/manager/tests/testcase.py
+++ b/wger/manager/tests/testcase.py
@@ -52,6 +52,7 @@ class BaseTestCase(object):
fixtures = ('days_of_week',
'gym-config',
+ 'groups',
'test-languages',
'test-licenses',
'test-gyms',