From 7d1fc7e08102786ff7af6251b9bc3145709701be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vegard=20Sporst=C3=B8l?= <vegarms@stud.ntnu.no>
Date: Fri, 5 Mar 2021 12:12:07 +0100
Subject: [PATCH] add all needed tests

---
 backend/secfit/users/tests.py    | 16 +++++++++++-
 backend/secfit/workouts/tests.py | 45 +++++++++++++++++++++++++++++---
 2 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/backend/secfit/users/tests.py b/backend/secfit/users/tests.py
index da6ff2a..180927b 100644
--- a/backend/secfit/users/tests.py
+++ b/backend/secfit/users/tests.py
@@ -11,8 +11,8 @@ from users.models import User
 
 from django.test import TestCase
 
+# Tests new registration, boundary values and 2-way domain
 class RegistrationTestCase(APITestCase):
-
     def test_registration(self):
         data = {"username": "testcase", "email": "test@test.no", 
                 "password": "strong_pwd", "password1": "strong_pwd", 
@@ -21,3 +21,17 @@ class RegistrationTestCase(APITestCase):
         response = self.client.post("/api/users/", data)
         self.assertEqual(response.status_code, status.HTTP_201_CREATED)
 
+    def test_boundaryValuesOfRegistration(self):
+        "Test boudary values of signup"
+
+    def test_domainRegistration(self):
+        "2-way domain tests to test the register page"
+
+# Tests new functionality in UC-2
+class Statistics(APITestCase):
+    def test_renderStatistics(self):
+        "test that the statistics are rendered"
+
+    def test_correctStatistics(self):
+        "Check that statistics are correctly calculated"
+
diff --git a/backend/secfit/workouts/tests.py b/backend/secfit/workouts/tests.py
index 7fbbf78..eb77571 100644
--- a/backend/secfit/workouts/tests.py
+++ b/backend/secfit/workouts/tests.py
@@ -1,6 +1,43 @@
-"""
-Tests for the workouts application.
-"""
+import json
+
+from django.contrib.auth.models import User
+from django.urls import reverse
+from rest_framework import status
+from rest_framework.authtoken.models import Token
+from rest_framework.test import APITestCase
+
+from users.serializers import UserSerializer
+from users.models import User
+
 from django.test import TestCase
 
-# Create your tests here.
+class NewWorkoutTestCase(APITestCase):
+    def test_newWorkoutRegistration(self):
+        "Test registering a new workout"
+
+    def test_boundaryValuesOfNewWorkout(self):
+        "test boundary values of new workout"
+
+
+class WorkoutDetails(APITestCase):
+    def test_viewDetails(self):
+        "Test that user can view all details"
+
+    def test_viewFiles(self):
+        "Test that user can view all files"
+
+    def test_viewComments(self):
+        "Test that user can view all comments"
+
+
+class Categories(APITestCase):
+    def test_categorizeExercise(self):
+        "test that categorizing exercise works"
+
+    def test_sortExercise(self):
+        "test that sorting exercise works"
+
+
+class NewWorkoutAsCoach(APITestCase):
+    def test_createWorkoutAsCoach(self):
+        "Check that a workout can be created as a coach"
\ No newline at end of file
-- 
GitLab