Commit e1ea3e71 authored by Tomas Vaagen Gule's avatar Tomas Vaagen Gule
Browse files

Add tests

parent c7c16c76
Pipeline #167108 passed with stages
in 2 minutes and 13 seconds
......@@ -7,3 +7,7 @@ venv
.DS_Store
frontend/package-lock.json
frontend/platforms/browser/config.xml
backend/secfit/coverage.xml
.env
frontend/platforms/browser/config.xml
frontend/package-lock.json
[{"model": "auth.permission", "pk": 1, "fields": {"name": "Can add log entry", "content_type": 1, "codename": "add_logentry"}}, {"model": "auth.permission", "pk": 2, "fields": {"name": "Can change log entry", "content_type": 1, "codename": "change_logentry"}}, {"model": "auth.permission", "pk": 3, "fields": {"name": "Can delete log entry", "content_type": 1, "codename": "delete_logentry"}}, {"model": "auth.permission", "pk": 4, "fields": {"name": "Can view log entry", "content_type": 1, "codename": "view_logentry"}}, {"model": "auth.permission", "pk": 5, "fields": {"name": "Can add permission", "content_type": 2, "codename": "add_permission"}}, {"model": "auth.permission", "pk": 6, "fields": {"name": "Can change permission", "content_type": 2, "codename": "change_permission"}}, {"model": "auth.permission", "pk": 7, "fields": {"name": "Can delete permission", "content_type": 2, "codename": "delete_permission"}}, {"model": "auth.permission", "pk": 8, "fields": {"name": "Can view permission", "content_type": 2, "codename": "view_permission"}}, {"model": "auth.permission", "pk": 9, "fields": {"name": "Can add group", "content_type": 3, "codename": "add_group"}}, {"model": "auth.permission", "pk": 10, "fields": {"name": "Can change group", "content_type": 3, "codename": "change_group"}}, {"model": "auth.permission", "pk": 11, "fields": {"name": "Can delete group", "content_type": 3, "codename": "delete_group"}}, {"model": "auth.permission", "pk": 12, "fields": {"name": "Can view group", "content_type": 3, "codename": "view_group"}}, {"model": "auth.permission", "pk": 13, "fields": {"name": "Can add content type", "content_type": 4, "codename": "add_contenttype"}}, {"model": "auth.permission", "pk": 14, "fields": {"name": "Can change content type", "content_type": 4, "codename": "change_contenttype"}}, {"model": "auth.permission", "pk": 15, "fields": {"name": "Can delete content type", "content_type": 4, "codename": "delete_contenttype"}}, {"model": "auth.permission", "pk": 16, "fields": {"name": "Can view content type", "content_type": 4, "codename": "view_contenttype"}}, {"model": "auth.permission", "pk": 17, "fields": {"name": "Can add session", "content_type": 5, "codename": "add_session"}}, {"model": "auth.permission", "pk": 18, "fields": {"name": "Can change session", "content_type": 5, "codename": "change_session"}}, {"model": "auth.permission", "pk": 19, "fields": {"name": "Can delete session", "content_type": 5, "codename": "delete_session"}}, {"model": "auth.permission", "pk": 20, "fields": {"name": "Can view session", "content_type": 5, "codename": "view_session"}}, {"model": "auth.permission", "pk": 21, "fields": {"name": "Can add exercise", "content_type": 6, "codename": "add_exercise"}}, {"model": "auth.permission", "pk": 22, "fields": {"name": "Can change exercise", "content_type": 6, "codename": "change_exercise"}}, {"model": "auth.permission", "pk": 23, "fields": {"name": "Can delete exercise", "content_type": 6, "codename": "delete_exercise"}}, {"model": "auth.permission", "pk": 24, "fields": {"name": "Can view exercise", "content_type": 6, "codename": "view_exercise"}}, {"model": "auth.permission", "pk": 25, "fields": {"name": "Can add workout", "content_type": 7, "codename": "add_workout"}}, {"model": "auth.permission", "pk": 26, "fields": {"name": "Can change workout", "content_type": 7, "codename": "change_workout"}}, {"model": "auth.permission", "pk": 27, "fields": {"name": "Can delete workout", "content_type": 7, "codename": "delete_workout"}}, {"model": "auth.permission", "pk": 28, "fields": {"name": "Can view workout", "content_type": 7, "codename": "view_workout"}}, {"model": "auth.permission", "pk": 29, "fields": {"name": "Can add workout file", "content_type": 8, "codename": "add_workoutfile"}}, {"model": "auth.permission", "pk": 30, "fields": {"name": "Can change workout file", "content_type": 8, "codename": "change_workoutfile"}}, {"model": "auth.permission", "pk": 31, "fields": {"name": "Can delete workout file", "content_type": 8, "codename": "delete_workoutfile"}}, {"model": "auth.permission", "pk": 32, "fields": {"name": "Can view workout file", "content_type": 8, "codename": "view_workoutfile"}}, {"model": "auth.permission", "pk": 33, "fields": {"name": "Can add exercise instance", "content_type": 9, "codename": "add_exerciseinstance"}}, {"model": "auth.permission", "pk": 34, "fields": {"name": "Can change exercise instance", "content_type": 9, "codename": "change_exerciseinstance"}}, {"model": "auth.permission", "pk": 35, "fields": {"name": "Can delete exercise instance", "content_type": 9, "codename": "delete_exerciseinstance"}}, {"model": "auth.permission", "pk": 36, "fields": {"name": "Can view exercise instance", "content_type": 9, "codename": "view_exerciseinstance"}}, {"model": "auth.permission", "pk": 37, "fields": {"name": "Can add remember me", "content_type": 10, "codename": "add_rememberme"}}, {"model": "auth.permission", "pk": 38, "fields": {"name": "Can change remember me", "content_type": 10, "codename": "change_rememberme"}}, {"model": "auth.permission", "pk": 39, "fields": {"name": "Can delete remember me", "content_type": 10, "codename": "delete_rememberme"}}, {"model": "auth.permission", "pk": 40, "fields": {"name": "Can view remember me", "content_type": 10, "codename": "view_rememberme"}}, {"model": "auth.permission", "pk": 41, "fields": {"name": "Can add meal", "content_type": 11, "codename": "add_meal"}}, {"model": "auth.permission", "pk": 42, "fields": {"name": "Can change meal", "content_type": 11, "codename": "change_meal"}}, {"model": "auth.permission", "pk": 43, "fields": {"name": "Can delete meal", "content_type": 11, "codename": "delete_meal"}}, {"model": "auth.permission", "pk": 44, "fields": {"name": "Can view meal", "content_type": 11, "codename": "view_meal"}}, {"model": "auth.permission", "pk": 45, "fields": {"name": "Can add meal file", "content_type": 12, "codename": "add_mealfile"}}, {"model": "auth.permission", "pk": 46, "fields": {"name": "Can change meal file", "content_type": 12, "codename": "change_mealfile"}}, {"model": "auth.permission", "pk": 47, "fields": {"name": "Can delete meal file", "content_type": 12, "codename": "delete_mealfile"}}, {"model": "auth.permission", "pk": 48, "fields": {"name": "Can view meal file", "content_type": 12, "codename": "view_mealfile"}}, {"model": "auth.permission", "pk": 49, "fields": {"name": "Can add user", "content_type": 13, "codename": "add_user"}}, {"model": "auth.permission", "pk": 50, "fields": {"name": "Can change user", "content_type": 13, "codename": "change_user"}}, {"model": "auth.permission", "pk": 51, "fields": {"name": "Can delete user", "content_type": 13, "codename": "delete_user"}}, {"model": "auth.permission", "pk": 52, "fields": {"name": "Can view user", "content_type": 13, "codename": "view_user"}}, {"model": "auth.permission", "pk": 53, "fields": {"name": "Can add athlete file", "content_type": 14, "codename": "add_athletefile"}}, {"model": "auth.permission", "pk": 54, "fields": {"name": "Can change athlete file", "content_type": 14, "codename": "change_athletefile"}}, {"model": "auth.permission", "pk": 55, "fields": {"name": "Can delete athlete file", "content_type": 14, "codename": "delete_athletefile"}}, {"model": "auth.permission", "pk": 56, "fields": {"name": "Can view athlete file", "content_type": 14, "codename": "view_athletefile"}}, {"model": "auth.permission", "pk": 57, "fields": {"name": "Can add offer", "content_type": 15, "codename": "add_offer"}}, {"model": "auth.permission", "pk": 58, "fields": {"name": "Can change offer", "content_type": 15, "codename": "change_offer"}}, {"model": "auth.permission", "pk": 59, "fields": {"name": "Can delete offer", "content_type": 15, "codename": "delete_offer"}}, {"model": "auth.permission", "pk": 60, "fields": {"name": "Can view offer", "content_type": 15, "codename": "view_offer"}}, {"model": "auth.permission", "pk": 61, "fields": {"name": "Can add comment", "content_type": 16, "codename": "add_comment"}}, {"model": "auth.permission", "pk": 62, "fields": {"name": "Can change comment", "content_type": 16, "codename": "change_comment"}}, {"model": "auth.permission", "pk": 63, "fields": {"name": "Can delete comment", "content_type": 16, "codename": "delete_comment"}}, {"model": "auth.permission", "pk": 64, "fields": {"name": "Can view comment", "content_type": 16, "codename": "view_comment"}}, {"model": "auth.permission", "pk": 65, "fields": {"name": "Can add like", "content_type": 17, "codename": "add_like"}}, {"model": "auth.permission", "pk": 66, "fields": {"name": "Can change like", "content_type": 17, "codename": "change_like"}}, {"model": "auth.permission", "pk": 67, "fields": {"name": "Can delete like", "content_type": 17, "codename": "delete_like"}}, {"model": "auth.permission", "pk": 68, "fields": {"name": "Can view like", "content_type": 17, "codename": "view_like"}}, {"model": "contenttypes.contenttype", "pk": 1, "fields": {"app_label": "admin", "model": "logentry"}}, {"model": "contenttypes.contenttype", "pk": 2, "fields": {"app_label": "auth", "model": "permission"}}, {"model": "contenttypes.contenttype", "pk": 3, "fields": {"app_label": "auth", "model": "group"}}, {"model": "contenttypes.contenttype", "pk": 4, "fields": {"app_label": "contenttypes", "model": "contenttype"}}, {"model": "contenttypes.contenttype", "pk": 5, "fields": {"app_label": "sessions", "model": "session"}}, {"model": "contenttypes.contenttype", "pk": 6, "fields": {"app_label": "workouts", "model": "exercise"}}, {"model": "contenttypes.contenttype", "pk": 7, "fields": {"app_label": "workouts", "model": "workout"}}, {"model": "contenttypes.contenttype", "pk": 8, "fields": {"app_label": "workouts", "model": "workoutfile"}}, {"model": "contenttypes.contenttype", "pk": 9, "fields": {"app_label": "workouts", "model": "exerciseinstance"}}, {"model": "contenttypes.contenttype", "pk": 10, "fields": {"app_label": "workouts", "model": "rememberme"}}, {"model": "contenttypes.contenttype", "pk": 11, "fields": {"app_label": "meals", "model": "meal"}}, {"model": "contenttypes.contenttype", "pk": 12, "fields": {"app_label": "meals", "model": "mealfile"}}, {"model": "contenttypes.contenttype", "pk": 13, "fields": {"app_label": "users", "model": "user"}}, {"model": "contenttypes.contenttype", "pk": 14, "fields": {"app_label": "users", "model": "athletefile"}}, {"model": "contenttypes.contenttype", "pk": 15, "fields": {"app_label": "users", "model": "offer"}}, {"model": "contenttypes.contenttype", "pk": 16, "fields": {"app_label": "comments", "model": "comment"}}, {"model": "contenttypes.contenttype", "pk": 17, "fields": {"app_label": "comments", "model": "like"}}, {"model": "sessions.session", "pk": "rx7k0n9z91109fhmrv991b1b1ld5n2u0", "fields": {"session_data": ".eJxVjMsOwiAQRf-FtSG8KS7d-w2EYQapGkhKuzL-uzbpQrf3nHNfLKZtrXEbtMQZ2ZlJdvrdIOUHtR3gPbVb57m3dZmB7wo_6ODXjvS8HO7fQU2jfusgnbMeAaQmVWwR1gdMkKGIBEJ5QyTsZLwRGoMJExqjSPsiXXGBcmHvD-FEN-I:1nTiXx:FjF6ponEkTJlXA7zmlrp3MpGudOxFXdqu4kHZIvw6mY", "expire_date": "2022-03-28T11:07:29.186Z"}}, {"model": "workouts.workout", "pk": 1, "fields": {"name": "Sterk", "date": "2022-03-09T11:08:00Z", "notes": "dfed", "owner": 1, "visibility": "PU", "intensity": "LOW"}}, {"model": "workouts.workout", "pk": 2, "fields": {"name": "Test", "date": "2022-03-18T12:07:00Z", "notes": "Cool", "owner": 1, "visibility": "PU", "intensity": "MEDIUM"}}, {"model": "workouts.exercise", "pk": 1, "fields": {"name": "Super", "description": "Bli sterk", "duration": 10, "calories": 100, "muscleGroup": "Back", "unit": "10"}}, {"model": "workouts.exercise", "pk": 2, "fields": {"name": "Knebøy", "description": "Strong", "duration": 2, "calories": 33, "muscleGroup": "Legs", "unit": "2"}}, {"model": "workouts.exerciseinstance", "pk": 1, "fields": {"workout": 1, "exercise": 1, "sets": 11, "number": 2, "resttime": 2}}, {"model": "workouts.exerciseinstance", "pk": 2, "fields": {"workout": 1, "exercise": 2, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 3, "fields": {"workout": 2, "exercise": 1, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 4, "fields": {"workout": 2, "exercise": 2, "sets": 1, "number": 1, "resttime": 1}}, {"model": "users.user", "pk": 1, "fields": {"password": "pbkdf2_sha256$216000$ZXPExCbJi83J$0MxoUUgm3C3ZHI2zsGPY9GYAGrdajRsNgIprMvjEDlg=", "last_login": "2022-03-14T11:07:29.182Z", "is_superuser": true, "username": "admin", "first_name": "", "last_name": "", "email": "", "is_staff": true, "is_active": true, "date_joined": "2022-03-14T11:07:22.261Z", "coach": null, "phone_number": "", "country": "", "city": "", "street_address": "", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 2, "fields": {"password": "Tomas97", "last_login": null, "is_superuser": false, "username": "tomas", "first_name": "", "last_name": "", "email": "tomas@gule.com", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T12:30:56.209Z", "coach": null, "phone_number": "97405177", "country": "Norge!!", "city": "Trondheim", "street_address": "Møllenberg", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 3, "fields": {"password": "pbkdf2_sha256$216000$HxINA6AToJp5$9TJ20B4q/LL+dOEYjfFUNICU43kDuZm3MS2rD+zzxes=", "last_login": null, "is_superuser": false, "username": "test", "first_name": "", "last_name": "", "email": "tomas@gule.com", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T14:35:57.775Z", "coach": null, "phone_number": "97405177", "country": "Norge!!", "city": "Trondheim", "street_address": "Møllenberg", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 4, "fields": {"password": "pbkdf2_sha256$216000$3bqs6NJeez0M$xgeDJA3E60vhme8k9GBIHltRTDW1DmLrZvPZr2P/CL4=", "last_login": null, "is_superuser": false, "username": "Tomas", "first_name": "", "last_name": "", "email": "tomas@tomas.no", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T15:07:54.818Z", "coach": null, "phone_number": "97405177", "country": "Test", "city": "Test", "street_address": "Test", "groups": [], "user_permissions": []}}]
\ No newline at end of file
[{"model": "auth.permission", "pk": 1, "fields": {"name": "Can add log entry", "content_type": 1, "codename": "add_logentry"}}, {"model": "auth.permission", "pk": 2, "fields": {"name": "Can change log entry", "content_type": 1, "codename": "change_logentry"}}, {"model": "auth.permission", "pk": 3, "fields": {"name": "Can delete log entry", "content_type": 1, "codename": "delete_logentry"}}, {"model": "auth.permission", "pk": 4, "fields": {"name": "Can view log entry", "content_type": 1, "codename": "view_logentry"}}, {"model": "auth.permission", "pk": 5, "fields": {"name": "Can add permission", "content_type": 2, "codename": "add_permission"}}, {"model": "auth.permission", "pk": 6, "fields": {"name": "Can change permission", "content_type": 2, "codename": "change_permission"}}, {"model": "auth.permission", "pk": 7, "fields": {"name": "Can delete permission", "content_type": 2, "codename": "delete_permission"}}, {"model": "auth.permission", "pk": 8, "fields": {"name": "Can view permission", "content_type": 2, "codename": "view_permission"}}, {"model": "auth.permission", "pk": 9, "fields": {"name": "Can add group", "content_type": 3, "codename": "add_group"}}, {"model": "auth.permission", "pk": 10, "fields": {"name": "Can change group", "content_type": 3, "codename": "change_group"}}, {"model": "auth.permission", "pk": 11, "fields": {"name": "Can delete group", "content_type": 3, "codename": "delete_group"}}, {"model": "auth.permission", "pk": 12, "fields": {"name": "Can view group", "content_type": 3, "codename": "view_group"}}, {"model": "auth.permission", "pk": 13, "fields": {"name": "Can add content type", "content_type": 4, "codename": "add_contenttype"}}, {"model": "auth.permission", "pk": 14, "fields": {"name": "Can change content type", "content_type": 4, "codename": "change_contenttype"}}, {"model": "auth.permission", "pk": 15, "fields": {"name": "Can delete content type", "content_type": 4, "codename": "delete_contenttype"}}, {"model": "auth.permission", "pk": 16, "fields": {"name": "Can view content type", "content_type": 4, "codename": "view_contenttype"}}, {"model": "auth.permission", "pk": 17, "fields": {"name": "Can add session", "content_type": 5, "codename": "add_session"}}, {"model": "auth.permission", "pk": 18, "fields": {"name": "Can change session", "content_type": 5, "codename": "change_session"}}, {"model": "auth.permission", "pk": 19, "fields": {"name": "Can delete session", "content_type": 5, "codename": "delete_session"}}, {"model": "auth.permission", "pk": 20, "fields": {"name": "Can view session", "content_type": 5, "codename": "view_session"}}, {"model": "auth.permission", "pk": 21, "fields": {"name": "Can add exercise", "content_type": 6, "codename": "add_exercise"}}, {"model": "auth.permission", "pk": 22, "fields": {"name": "Can change exercise", "content_type": 6, "codename": "change_exercise"}}, {"model": "auth.permission", "pk": 23, "fields": {"name": "Can delete exercise", "content_type": 6, "codename": "delete_exercise"}}, {"model": "auth.permission", "pk": 24, "fields": {"name": "Can view exercise", "content_type": 6, "codename": "view_exercise"}}, {"model": "auth.permission", "pk": 25, "fields": {"name": "Can add workout", "content_type": 7, "codename": "add_workout"}}, {"model": "auth.permission", "pk": 26, "fields": {"name": "Can change workout", "content_type": 7, "codename": "change_workout"}}, {"model": "auth.permission", "pk": 27, "fields": {"name": "Can delete workout", "content_type": 7, "codename": "delete_workout"}}, {"model": "auth.permission", "pk": 28, "fields": {"name": "Can view workout", "content_type": 7, "codename": "view_workout"}}, {"model": "auth.permission", "pk": 29, "fields": {"name": "Can add workout file", "content_type": 8, "codename": "add_workoutfile"}}, {"model": "auth.permission", "pk": 30, "fields": {"name": "Can change workout file", "content_type": 8, "codename": "change_workoutfile"}}, {"model": "auth.permission", "pk": 31, "fields": {"name": "Can delete workout file", "content_type": 8, "codename": "delete_workoutfile"}}, {"model": "auth.permission", "pk": 32, "fields": {"name": "Can view workout file", "content_type": 8, "codename": "view_workoutfile"}}, {"model": "auth.permission", "pk": 33, "fields": {"name": "Can add exercise instance", "content_type": 9, "codename": "add_exerciseinstance"}}, {"model": "auth.permission", "pk": 34, "fields": {"name": "Can change exercise instance", "content_type": 9, "codename": "change_exerciseinstance"}}, {"model": "auth.permission", "pk": 35, "fields": {"name": "Can delete exercise instance", "content_type": 9, "codename": "delete_exerciseinstance"}}, {"model": "auth.permission", "pk": 36, "fields": {"name": "Can view exercise instance", "content_type": 9, "codename": "view_exerciseinstance"}}, {"model": "auth.permission", "pk": 37, "fields": {"name": "Can add remember me", "content_type": 10, "codename": "add_rememberme"}}, {"model": "auth.permission", "pk": 38, "fields": {"name": "Can change remember me", "content_type": 10, "codename": "change_rememberme"}}, {"model": "auth.permission", "pk": 39, "fields": {"name": "Can delete remember me", "content_type": 10, "codename": "delete_rememberme"}}, {"model": "auth.permission", "pk": 40, "fields": {"name": "Can view remember me", "content_type": 10, "codename": "view_rememberme"}}, {"model": "auth.permission", "pk": 41, "fields": {"name": "Can add meal", "content_type": 11, "codename": "add_meal"}}, {"model": "auth.permission", "pk": 42, "fields": {"name": "Can change meal", "content_type": 11, "codename": "change_meal"}}, {"model": "auth.permission", "pk": 43, "fields": {"name": "Can delete meal", "content_type": 11, "codename": "delete_meal"}}, {"model": "auth.permission", "pk": 44, "fields": {"name": "Can view meal", "content_type": 11, "codename": "view_meal"}}, {"model": "auth.permission", "pk": 45, "fields": {"name": "Can add meal file", "content_type": 12, "codename": "add_mealfile"}}, {"model": "auth.permission", "pk": 46, "fields": {"name": "Can change meal file", "content_type": 12, "codename": "change_mealfile"}}, {"model": "auth.permission", "pk": 47, "fields": {"name": "Can delete meal file", "content_type": 12, "codename": "delete_mealfile"}}, {"model": "auth.permission", "pk": 48, "fields": {"name": "Can view meal file", "content_type": 12, "codename": "view_mealfile"}}, {"model": "auth.permission", "pk": 49, "fields": {"name": "Can add user", "content_type": 13, "codename": "add_user"}}, {"model": "auth.permission", "pk": 50, "fields": {"name": "Can change user", "content_type": 13, "codename": "change_user"}}, {"model": "auth.permission", "pk": 51, "fields": {"name": "Can delete user", "content_type": 13, "codename": "delete_user"}}, {"model": "auth.permission", "pk": 52, "fields": {"name": "Can view user", "content_type": 13, "codename": "view_user"}}, {"model": "auth.permission", "pk": 53, "fields": {"name": "Can add athlete file", "content_type": 14, "codename": "add_athletefile"}}, {"model": "auth.permission", "pk": 54, "fields": {"name": "Can change athlete file", "content_type": 14, "codename": "change_athletefile"}}, {"model": "auth.permission", "pk": 55, "fields": {"name": "Can delete athlete file", "content_type": 14, "codename": "delete_athletefile"}}, {"model": "auth.permission", "pk": 56, "fields": {"name": "Can view athlete file", "content_type": 14, "codename": "view_athletefile"}}, {"model": "auth.permission", "pk": 57, "fields": {"name": "Can add offer", "content_type": 15, "codename": "add_offer"}}, {"model": "auth.permission", "pk": 58, "fields": {"name": "Can change offer", "content_type": 15, "codename": "change_offer"}}, {"model": "auth.permission", "pk": 59, "fields": {"name": "Can delete offer", "content_type": 15, "codename": "delete_offer"}}, {"model": "auth.permission", "pk": 60, "fields": {"name": "Can view offer", "content_type": 15, "codename": "view_offer"}}, {"model": "auth.permission", "pk": 61, "fields": {"name": "Can add comment", "content_type": 16, "codename": "add_comment"}}, {"model": "auth.permission", "pk": 62, "fields": {"name": "Can change comment", "content_type": 16, "codename": "change_comment"}}, {"model": "auth.permission", "pk": 63, "fields": {"name": "Can delete comment", "content_type": 16, "codename": "delete_comment"}}, {"model": "auth.permission", "pk": 64, "fields": {"name": "Can view comment", "content_type": 16, "codename": "view_comment"}}, {"model": "auth.permission", "pk": 65, "fields": {"name": "Can add like", "content_type": 17, "codename": "add_like"}}, {"model": "auth.permission", "pk": 66, "fields": {"name": "Can change like", "content_type": 17, "codename": "change_like"}}, {"model": "auth.permission", "pk": 67, "fields": {"name": "Can delete like", "content_type": 17, "codename": "delete_like"}}, {"model": "auth.permission", "pk": 68, "fields": {"name": "Can view like", "content_type": 17, "codename": "view_like"}}, {"model": "contenttypes.contenttype", "pk": 1, "fields": {"app_label": "admin", "model": "logentry"}}, {"model": "contenttypes.contenttype", "pk": 2, "fields": {"app_label": "auth", "model": "permission"}}, {"model": "contenttypes.contenttype", "pk": 3, "fields": {"app_label": "auth", "model": "group"}}, {"model": "contenttypes.contenttype", "pk": 4, "fields": {"app_label": "contenttypes", "model": "contenttype"}}, {"model": "contenttypes.contenttype", "pk": 5, "fields": {"app_label": "sessions", "model": "session"}}, {"model": "contenttypes.contenttype", "pk": 6, "fields": {"app_label": "workouts", "model": "exercise"}}, {"model": "contenttypes.contenttype", "pk": 7, "fields": {"app_label": "workouts", "model": "workout"}}, {"model": "contenttypes.contenttype", "pk": 8, "fields": {"app_label": "workouts", "model": "workoutfile"}}, {"model": "contenttypes.contenttype", "pk": 9, "fields": {"app_label": "workouts", "model": "exerciseinstance"}}, {"model": "contenttypes.contenttype", "pk": 10, "fields": {"app_label": "workouts", "model": "rememberme"}}, {"model": "contenttypes.contenttype", "pk": 11, "fields": {"app_label": "meals", "model": "meal"}}, {"model": "contenttypes.contenttype", "pk": 12, "fields": {"app_label": "meals", "model": "mealfile"}}, {"model": "contenttypes.contenttype", "pk": 13, "fields": {"app_label": "users", "model": "user"}}, {"model": "contenttypes.contenttype", "pk": 14, "fields": {"app_label": "users", "model": "athletefile"}}, {"model": "contenttypes.contenttype", "pk": 15, "fields": {"app_label": "users", "model": "offer"}}, {"model": "contenttypes.contenttype", "pk": 16, "fields": {"app_label": "comments", "model": "comment"}}, {"model": "contenttypes.contenttype", "pk": 17, "fields": {"app_label": "comments", "model": "like"}}, {"model": "sessions.session", "pk": "rx7k0n9z91109fhmrv991b1b1ld5n2u0", "fields": {"session_data": ".eJxVjMsOwiAQRf-FtSG8KS7d-w2EYQapGkhKuzL-uzbpQrf3nHNfLKZtrXEbtMQZ2ZlJdvrdIOUHtR3gPbVb57m3dZmB7wo_6ODXjvS8HO7fQU2jfusgnbMeAaQmVWwR1gdMkKGIBEJ5QyTsZLwRGoMJExqjSPsiXXGBcmHvD-FEN-I:1nTiXx:FjF6ponEkTJlXA7zmlrp3MpGudOxFXdqu4kHZIvw6mY", "expire_date": "2022-03-28T11:07:29.186Z"}}, {"model": "workouts.workout", "pk": 1, "fields": {"name": "Sterk", "date": "2022-03-09T11:08:00Z", "notes": "dfed", "owner": 1, "visibility": "PU", "intensity": "LOW"}}, {"model": "workouts.workout", "pk": 2, "fields": {"name": "Test", "date": "2022-03-18T12:07:00Z", "notes": "Cool", "owner": 1, "visibility": "PU", "intensity": "MEDIUM"}}, {"model": "workouts.workout", "pk": 3, "fields": {"name": "Public", "date": "2022-03-23T14:10:00Z", "notes": "Notes", "owner": 6, "visibility": "PU", "intensity": "HIGH"}}, {"model": "workouts.workout", "pk": 4, "fields": {"name": "Coach", "date": "2022-03-18T14:11:00Z", "notes": "Note", "owner": 6, "visibility": "CO", "intensity": "LOW"}}, {"model": "workouts.workout", "pk": 5, "fields": {"name": "Private", "date": "2022-03-18T14:11:00Z", "notes": "afaew", "owner": 6, "visibility": "PR", "intensity": "LOW"}}, {"model": "workouts.exercise", "pk": 1, "fields": {"name": "Super", "description": "Bli sterk", "duration": 10, "calories": 100, "muscleGroup": "Back", "unit": "10"}}, {"model": "workouts.exercise", "pk": 2, "fields": {"name": "Knebøy", "description": "Strong", "duration": 2, "calories": 33, "muscleGroup": "Legs", "unit": "2"}}, {"model": "workouts.exerciseinstance", "pk": 1, "fields": {"workout": 1, "exercise": 1, "sets": 11, "number": 2, "resttime": 2}}, {"model": "workouts.exerciseinstance", "pk": 2, "fields": {"workout": 1, "exercise": 2, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 3, "fields": {"workout": 2, "exercise": 1, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 4, "fields": {"workout": 2, "exercise": 2, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 5, "fields": {"workout": 3, "exercise": 1, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 6, "fields": {"workout": 4, "exercise": 1, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.exerciseinstance", "pk": 7, "fields": {"workout": 5, "exercise": 1, "sets": 1, "number": 1, "resttime": 1}}, {"model": "workouts.workoutfile", "pk": 1, "fields": {"workout": 3, "owner": 6, "file": "workouts/3/e-mail.png"}}, {"model": "workouts.workoutfile", "pk": 2, "fields": {"workout": 4, "owner": 6, "file": "workouts/4/create_user_verify.png"}}, {"model": "workouts.workoutfile", "pk": 3, "fields": {"workout": 5, "owner": 6, "file": "workouts/5/Header.png"}}, {"model": "users.user", "pk": 1, "fields": {"password": "pbkdf2_sha256$216000$ZXPExCbJi83J$0MxoUUgm3C3ZHI2zsGPY9GYAGrdajRsNgIprMvjEDlg=", "last_login": "2022-03-14T11:07:29.182Z", "is_superuser": true, "username": "admin", "first_name": "", "last_name": "", "email": "", "is_staff": true, "is_active": true, "date_joined": "2022-03-14T11:07:22.261Z", "coach": null, "phone_number": "", "country": "", "city": "", "street_address": "", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 2, "fields": {"password": "Tomas97", "last_login": null, "is_superuser": false, "username": "tomas", "first_name": "", "last_name": "", "email": "tomas@gule.com", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T12:30:56.209Z", "coach": null, "phone_number": "97405177", "country": "Norge!!", "city": "Trondheim", "street_address": "Møllenberg", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 3, "fields": {"password": "pbkdf2_sha256$216000$HxINA6AToJp5$9TJ20B4q/LL+dOEYjfFUNICU43kDuZm3MS2rD+zzxes=", "last_login": null, "is_superuser": false, "username": "test", "first_name": "", "last_name": "", "email": "tomas@gule.com", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T14:35:57.775Z", "coach": null, "phone_number": "97405177", "country": "Norge!!", "city": "Trondheim", "street_address": "Møllenberg", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 4, "fields": {"password": "pbkdf2_sha256$216000$3bqs6NJeez0M$xgeDJA3E60vhme8k9GBIHltRTDW1DmLrZvPZr2P/CL4=", "last_login": null, "is_superuser": false, "username": "Tomas", "first_name": "", "last_name": "", "email": "tomas@tomas.no", "is_staff": false, "is_active": true, "date_joined": "2022-03-14T15:07:54.818Z", "coach": null, "phone_number": "97405177", "country": "Test", "city": "Test", "street_address": "Test", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 5, "fields": {"password": "pbkdf2_sha256$216000$gtG37E8x7VlM$q8//YpGv8C1XHhr/0s8Rjmyi20ZAviEdIm0jfcWvJ0I=", "last_login": null, "is_superuser": false, "username": "Coach", "first_name": "", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2022-03-21T14:09:08.161Z", "coach": null, "phone_number": "", "country": "", "city": "", "street_address": "", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 6, "fields": {"password": "pbkdf2_sha256$216000$xErWsSH45SPL$TRgqghPmp+U5tBsoan/vdqOpSAm0CcwMD+mtNCbNtdo=", "last_login": null, "is_superuser": false, "username": "Athlete", "first_name": "", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2022-03-21T14:10:09.354Z", "coach": 5, "phone_number": "", "country": "", "city": "", "street_address": "", "groups": [], "user_permissions": []}}, {"model": "users.user", "pk": 7, "fields": {"password": "pbkdf2_sha256$216000$TQfOR0xj7a4e$DJlhqa4fMNczxZxzpjMLdn5j6TABv1SrRaaJU+S7OLg=", "last_login": null, "is_superuser": false, "username": "Visitor", "first_name": "", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2022-03-21T14:12:23.760Z", "coach": null, "phone_number": "", "country": "", "city": "", "street_address": "", "groups": [], "user_permissions": []}}]
\ No newline at end of file
......@@ -94,6 +94,7 @@ class WorkoutSerializer(serializers.HyperlinkedModelSerializer):
Returns:
Workout: A newly created Workout
"""
print(validated_data)
exercise_instances_data = validated_data.pop("exercise_instances")
files_data = []
if "files" in validated_data:
......
{
"baseUrl": "http://localhost:3000"
}
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
//Workouts and users are added to the initial testData.
describe("Check if athlete can accsess all his workout", () => {
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("Athlete");
cy.get('input[name="password"]').type("1234");
cy.get('input[id="btn-login"]').click();
cy.wait(150);
});
it("Athlete should have access to his own private workout", () => {
cy.get("h5").contains("Private");
});
it("Athlete should have access to his own coach workout", () => {
cy.get("h5").contains("Coach");
});
it("Athlete should have access to his own public workout", () => {
cy.get("h5").contains("Public");
});
});
describe("Check if coach can accsess all his workout", () => {
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("Coach");
cy.get('input[name="password"]').type("1234");
cy.get('input[id="btn-login"]').click();
cy.wait(150);
});
it("Coach should not have access to his athlets private workout", () => {
cy.get("h5").contains("Private").should("not.exist");
});
it("Coach should have access to his athlets coach workout", () => {
cy.get("h5").contains("Coach");
});
it("Coach should have access to his athlets public workout", () => {
cy.get("h5").contains("Public");
});
});
describe("Check if visitor can access all his workout", () => {
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("Visitor");
cy.get('input[name="password"]').type("1234");
cy.get('input[id="btn-login"]').click();
cy.wait(150);
});
it("Visitor should not have access to athletes private workouts", () => {
cy.get("h5").contains("Private").should("not.exist");
});
it("Visitor should not have access to athletes coach workouts", () => {
cy.get("h5").contains("Coach").should("not.exist");
});
it("Visitor should have access to athletes public workouts", () => {
cy.get("h5").contains("Public");
});
});
describe("Boundary test: Calories", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser1");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser1");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
cy.get('a[id="nav-exercises"]').should("be.visible").click();
cy.get('input[id="btn-create-exercise"]').should("be.visible").click();
cy.wait(150);
cy.get('input[name="name"]').type("Test");
cy.get('textarea[name="description"]').type("Test");
cy.get('input[name="unit"]').type("1");
cy.get('input[name="duration"]').type("1");
});
it("Should faile if calories is less than 0.", () => {
cy.get('input[name="calories"]').type("-1");
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("calories");
});
it("Should pass if calories is between or equal to 0 and 10000.", () => {
cy.get('input[name="calories"]').type("0");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if calories is between or equal to 0 and 10000.", () => {
cy.get('input[name="calories"]').type("1");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if calories is between or equal to 0 and 10000.", () => {
cy.get('input[name="calories"]').type("5000");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if calories is between or equal to 0 and 10000.", () => {
cy.get('input[name="calories"]').type("9999");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if calories is between or equal to 0 and 10000.", () => {
cy.get('input[name="calories"]').type("10000");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should fail if calories is bigger than 0 and 10000.", () => {
cy.get('input[name="calories"]').type("10001");
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("calories");
});
});
describe("Boundary test: Duration", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser2");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser2");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
cy.get('a[id="nav-exercises"]').should("be.visible").click();
cy.get('input[id="btn-create-exercise"]').should("be.visible").click();
cy.get('input[name="name"]').type("Test");
cy.get('textarea[name="description"]').type("Test");
cy.get('input[name="unit"]').type("1");
cy.get('input[name="calories"]').type("2");
});
it("Should faile if duartion is less than 0.", () => {
cy.get('input[name="duration"]').type("-1");
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("duration");
});
it("Should pass if duartion is between or equal to 0 and 10000.", () => {
cy.get('input[name="duration"]').type("0");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if duartion is between or equal to 0 and 10000.", () => {
cy.get('input[name="duration"]').type("1");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if duartion is between or equal to 0 and 10000.", () => {
cy.get('input[name="duration"]').type("5000");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if duartion is between or equal to 0 and 10000.", () => {
cy.get('input[name="duration"]').type("9999");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if duartion is between or equal to 0 and 10000.", () => {
cy.get('input[name="duration"]').type("10000");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should fail if duartion is bigger than 0 and 10000.", () => {
cy.get('input[name="duration"]').type("10001");
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("duration");
});
});
describe("Boundary test: Units", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser1");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser1");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
cy.get('a[id="nav-exercises"]').should("be.visible").click();
cy.get('input[id="btn-create-exercise"]').should("be.visible").click();
cy.get('input[name="name"]').type("Test");
cy.get('textarea[name="description"]').type("Test");
cy.get('input[name="calories"]').type("1");
cy.get('input[name="duration"]').type("1");
});
it("Should faile if no unit is typed.", () => {
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("unit");
});
it("Should pass if unit length is between or equal to 1 and 15 characters long.", () => {
cy.get('input[name="unit"]').type("a");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if unit length is between or equal to 1 and 15 characters long.", () => {
cy.get('input[name="unit"]').type("aa");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if unit length is between or equal to 1 and 15 characters long.", () => {
cy.get('input[name="unit"]').type("aaaaaaa");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if unit length is between or equal to 1 and 15 characters long.", () => {
cy.get('input[name="unit"]').type("aaaaaaaaaaaaaa");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should pass if unit length is between or equal to 1 and 15 characters long.", () => {
cy.get('input[name="unit"]').type("aaaaaaaaaaaaaaa");
cy.get('input[id="btn-ok-exercise"]').click();
cy.url().should("eq", "http://localhost:3000/exercises.html");
});
it("Should fail if unit length is longer than 15", () => {
cy.get('input[name="unit"]').type("aaaaaaaaaaaaaaa");
cy.get('input[id="btn-ok-exercise"]').click();
cy.contains("Could not create new exercise");
cy.contains("calories");
});
});
describe("Test FR 01-02", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
});
it("Test if rest time field exist", () => {
cy.get('input[id="btn-create-workout"]').should("be.visible").click();
cy.get('input[name="resttime"]');
});
it("Test choose intensity", () => {
cy.get('input[id="btn-create-workout"]').should("be.visible").click();
cy.get('select[name="intensity"]').select("Low");
cy.get('select[name="intensity"]').select("Medium");
cy.get('select[name="intensity"]').select("High");
});
});
describe("Test FR 03-05", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
});
it("Test to create an workout and check if the values are right when ", () => {
const workoutName = "ThisIsWorkout";
cy.get('input[id="btn-create-workout"]').should("be.visible").click();
cy.get('input[name="name"]').type(workoutName);
cy.get('input[name="date"]').type("2022-12-12T20:20");
cy.get('textArea[name="notes"]').type("Notes");
cy.get('input[name="sets"]').type("1");
cy.get('input[name="number"]').type("1");
cy.get('input[name="resttime"]').type("1");
cy.get('select[name="type"]').select("Super");
cy.get('input[id="btn-ok-workout"]').click();
cy.get("h5")
.contains(workoutName)
.parent()
.parent()
.within(() => {
cy.get("table")
.children()
.within(() => {
cy.get("tr").contains("Duration").parent().contains("11");
cy.get("tr").contains("Calories").parent().contains("100");
cy.get("tr").contains("Muscle Groups").parent().contains("Back");
cy.get("tr").contains("Intensity").parent().contains("LOW");
});
});
});
});
describe("Test FR 06", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser9");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
});
it("Test if rest time field exist", () => {
cy.visit("workouts.html");
cy.get(".navbar-brand").click();
cy.url().should("eq", "http://localhost:3000/index.html");
});
});
describe("Test FR 07-09", () => {
before(() => {
cy.visit("register.html");
cy.get('input[name="username"]').type("testuser10");
cy.get('input[name="password"]').type("1");
cy.get('input[name="password1"]').type("1");
cy.get('input[id="btn-create-account"]').click();
});
beforeEach(() => {
cy.visit("login.html");
cy.get('input[name="username"]').type("testuser10");
cy.get('input[name="password"]').type("1");
cy.get('input[id="btn-login"]').click();
});
it("Test if changing personal info works", () => {
const email = "test@test.test";
const phone_number = 12345678;
const country = "norway";
const city = "trondheim";
const street_address = "NTNU";
cy.get('a[id="nav-mypage"]').should("be.visible").click();
cy.wait(150);
cy.get('input[id="btn-edit-account"]')
.should("be.visible")
.click({ force: true });
cy.get('input[id="btn-edit-account"]').should("not.be.visible");
cy.get('input[name="email"]').should("not.be.disabled").clear().type(email);
cy.get('input[name="phone_number"]')
.should("not.be.disabled")
.clear()
.type(phone_number);
cy.get('input[name="country"]')
.should("not.be.disabled")
.clear()
.type(country);
cy.get('input[name="city"]').should("not.be.disabled").clear().type(city);
cy.get('input[name="street_address"]')
.should("not.be.disabled")
.clear()
.type(street_address);
cy.get('input[id="btn-confirm-changes"]').should("not.be.disabled").click();
cy.reload(false);
cy.wait(150);
cy.get('input[name="email"]').should("have.value", email);
cy.get('input[name="phone_number"]').should("have.value", phone_number);
cy.get('input[name="country"]').should("have.value", country);
cy.get('input[name="city"]').should("have.value", city);
cy.get('input[name="street_address"]').should("have.value", street_address);
});