Unverified Commit 30948248 authored by KristofferHaakonsen's avatar KristofferHaakonsen
Browse files

Add comments

parent 2a72b074
Pipeline #116723 passed with stages
in 3 minutes and 27 seconds
......@@ -10,8 +10,10 @@ 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 the functionality for UC2
Integration testing for new feature: UC2
"""
......@@ -24,7 +26,6 @@ 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()
......
......@@ -13,8 +13,10 @@ import json
from unittest import skip
import random
'''
Serializer
Serializer tests
  • Kunne eventuelt skrive at det er full coverage statement test for UserSerializer, men hvis det skaper problemer for deployment så kan vi la være :P

Please register or sign in to reply
'''
class UserSerializerTestCase(APITestCase):
......@@ -174,8 +176,9 @@ class UserSerializerTestCase(APITestCase):
'''
Boundary values
Boundary value tests
'''
defaultDataRegister = {
"username": "johnDoe", "email": "johnDoe@webserver.com", "password": "johnsPassword", "password1": "johnsPassword", "phone_number": "11223344", "country": "Norway", "city": "Trondheim", "street_address": "Kongens gate 33"
}
......@@ -457,7 +460,6 @@ class PhoneBoundaryTestCase(TestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
class CountryBoundaryTestCase(TestCase):
def setUp(self):
# Adds some randomness
......@@ -528,7 +530,6 @@ class CountryBoundaryTestCase(TestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
class CityBoundaryTestCase(TestCase):
def setUp(self):
# Adds some randomness
......@@ -594,8 +595,6 @@ class CityBoundaryTestCase(TestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
class Street_AdressBoundaryTestCase(TestCase):
def setUp(self):
# Adds some randomness
......@@ -668,12 +667,14 @@ 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 loops to test the data togheter
2. Do several iterations to test the data togheter
3. Return results
'''
......
......@@ -15,6 +15,10 @@ import pytz
from rest_framework.request import Request
'''
Test permmisions.py
  • Evt. test full statement coverage test for permissions.py. Men dette funker også

Please register or sign in to reply
'''
class WorkoutPermissionsTestCases(TestCase):
def setUp(self):
self.owner = get_user_model()(id=1, username='owner', email='email@email.com', phone_number='92134654',
......@@ -267,8 +271,11 @@ class WorkoutPermissionsTestCases(TestCase):
self, request=self.request, view=None, obj=None))
'''
Boundary values
Boundary value tests
'''
defaultDataWorkout = {"name": "workoutname", "date": "2021-01-1T13:29:00.000Z", "notes": "notes",
"visibility": "PU", "planned": "false", "exercise_instances": [], "filename": []}
......@@ -676,6 +683,14 @@ class Exercise_instancesBoundaryTestCase(TestCase):
self.assertEqual(response.status_code, 400)
'''
Integration test new feature: UC1
'''
class IntegrationTestPlannedWorkout(APITestCase):
def setUp(self):
self.client = APIClient()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment