Skip to content
Snippets Groups Projects
Commit 7d1fc7e0 authored by Vegard Murvold Sporstøl's avatar Vegard Murvold Sporstøl
Browse files

add all needed tests

parent 1e96df7c
No related branches found
No related tags found
1 merge request!7Task3
Pipeline #113588 passed
......@@ -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"
"""
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment