From 94ffe38148ebea0032cc7ff0596a906852b0d206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20H=C3=A5kon=20H=C3=A5konsen?= <kristohh@stud.ntnu.no> Date: Mon, 15 Mar 2021 10:55:02 +0100 Subject: [PATCH] Revert "Add comments" This reverts commit 309482484f0d1023af1c542e5eca00f79e010a6b --- backend/secfit/suggested_workouts/tests.py | 5 ++--- backend/secfit/users/tests.py | 15 +++++++-------- backend/secfit/workouts/tests.py | 17 +---------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/backend/secfit/suggested_workouts/tests.py b/backend/secfit/suggested_workouts/tests.py index f7e22e2..a3793f9 100644 --- a/backend/secfit/suggested_workouts/tests.py +++ b/backend/secfit/suggested_workouts/tests.py @@ -10,10 +10,8 @@ from workouts.serializers import ExerciseSerializer from django.urls import reverse from suggested_workouts.views import createSuggestedWorkouts, detailedSuggestedWorkout from rest_framework import status - - """ -Integration testing for new feature: UC2 +Integration testing for the functionality for UC2 """ @@ -26,6 +24,7 @@ functions as expected together with the serializer, meaning that we test wheter to deserialize, serialize, updating and creating an instance of SuggestedWorkout. """ + class SuggestedWorkoutTestCase(APITestCase): def setUp(self): self.factory = APIRequestFactory() diff --git a/backend/secfit/users/tests.py b/backend/secfit/users/tests.py index 6b66a60..90329a7 100644 --- a/backend/secfit/users/tests.py +++ b/backend/secfit/users/tests.py @@ -13,10 +13,8 @@ import json from unittest import skip import random - - ''' - Serializer tests + Serializer ''' class UserSerializerTestCase(APITestCase): @@ -176,9 +174,8 @@ class UserSerializerTestCase(APITestCase): ''' - Boundary value tests + Boundary values ''' - defaultDataRegister = { "username": "johnDoe", "email": "johnDoe@webserver.com", "password": "johnsPassword", "password1": "johnsPassword", "phone_number": "11223344", "country": "Norway", "city": "Trondheim", "street_address": "Kongens gate 33" } @@ -460,6 +457,7 @@ class PhoneBoundaryTestCase(TestCase): self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + class CountryBoundaryTestCase(TestCase): def setUp(self): # Adds some randomness @@ -530,6 +528,7 @@ class CountryBoundaryTestCase(TestCase): self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + class CityBoundaryTestCase(TestCase): def setUp(self): # Adds some randomness @@ -595,6 +594,8 @@ class CityBoundaryTestCase(TestCase): self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) + + class Street_AdressBoundaryTestCase(TestCase): def setUp(self): # Adds some randomness @@ -667,14 +668,12 @@ class Street_AdressBoundaryTestCase(TestCase): - - ''' 2-way domain testing We will do the following: 1. Define data, we will reuse the same data as in boundary values (ideally this could be automated so that all the data is only stored in one place, the validity could be set from the tests themselfs) - 2. Do several iterations to test the data togheter + 2. Do several loops to test the data togheter 3. Return results ''' diff --git a/backend/secfit/workouts/tests.py b/backend/secfit/workouts/tests.py index 959df1e..6b16dcc 100644 --- a/backend/secfit/workouts/tests.py +++ b/backend/secfit/workouts/tests.py @@ -15,10 +15,6 @@ import pytz from rest_framework.request import Request -''' - Test permmisions.py -''' - class WorkoutPermissionsTestCases(TestCase): def setUp(self): self.owner = get_user_model()(id=1, username='owner', email='email@email.com', phone_number='92134654', @@ -271,11 +267,8 @@ class WorkoutPermissionsTestCases(TestCase): self, request=self.request, view=None, obj=None)) - - - ''' - Boundary value tests + Boundary values ''' defaultDataWorkout = {"name": "workoutname", "date": "2021-01-1T13:29:00.000Z", "notes": "notes", "visibility": "PU", "planned": "false", "exercise_instances": [], "filename": []} @@ -683,14 +676,6 @@ class Exercise_instancesBoundaryTestCase(TestCase): self.assertEqual(response.status_code, 400) - - - - -''' - Integration test new feature: UC1 -''' - class IntegrationTestPlannedWorkout(APITestCase): def setUp(self): self.client = APIClient() -- GitLab