Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kristoffer Håkon Håkonsen
tdt4242-base
Commits
2aaad23c
Commit
2aaad23c
authored
Mar 08, 2021
by
Kristoffer Håkon Håkonsen
Browse files
Revert "add boundary value tests"
This reverts commit
c64de224
parent
c64de224
Pipeline
#114338
failed with stages
in 1 minute and 22 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
backend/secfit/users/tests.py
View file @
2aaad23c
This diff is collapsed.
Click to expand it.
backend/secfit/workouts/tests.py
View file @
2aaad23c
...
...
@@ -3,14 +3,8 @@ from django.test import RequestFactory, TestCase
from
workouts.permissions
import
IsOwner
,
IsOwnerOfWorkout
,
IsCoachAndVisibleToCoach
,
IsCoachOfWorkoutAndVisibleToCoach
,
IsPublic
,
IsWorkoutPublic
,
IsReadOnly
from
django.utils
import
timezone
from
workouts.models
import
Workout
,
ExerciseInstance
,
Exercise
from
rest_framework.test
import
APIRequestFactory
,
APITestCase
,
APIClient
from
rest_framework
import
status
from
unittest
import
skip
from
users.models
import
User
import
json
'''
Serializers
'''
from
rest_framework.test
import
APIRequestFactory
,
APITestCase
class
WorkoutPermissionsTestCases
(
TestCase
):
def
setUp
(
self
):
...
...
@@ -113,6 +107,7 @@ class WorkoutPermissionsTestCases(TestCase):
self
.
coach_of_owner
.
save
()
self
.
owner
.
coach
=
self
.
coach_of_owner
self
.
owner
.
save
()
print
(
self
.
owner
.
coach
)
self
.
request
.
user
=
self
.
coach_of_owner
permission_class
=
IsCoachAndVisibleToCoach
self
.
assertTrue
(
IsCoachAndVisibleToCoach
.
has_object_permission
(
...
...
@@ -262,25 +257,3 @@ class WorkoutPermissionsTestCases(TestCase):
self
.
request
.
method
=
'OPTIONS'
self
.
assertTrue
(
permission_class
.
has_object_permission
(
self
,
request
=
self
.
request
,
view
=
None
,
obj
=
None
))
'''
Boundary values
'''
defaultDataWorkout
=
{
"name"
:
"workoutname"
,
"date"
:
"2021-01-1T13:29:00.000Z"
,
"notes"
:
"notes"
,
"visibility"
:
"PU"
,
"planned"
:
"false"
,
"exercise_instances"
:
[],
"filename"
:
[]}
counter
=
0
class
WorkoutnameBoundaryTestCase
(
TestCase
):
def
setUp
(
self
):
print
(
"setup"
)
User
.
objects
.
create
(
id
=
"99"
,
username
=
"JohnDoe"
,
password
=
"JohnDoePassword"
)
self
.
client
=
APIClient
()
self
.
user
=
User
.
objects
.
get
(
id
=
"99"
)
self
.
client
.
force_authenticate
(
user
=
self
.
user
)
def
test_simple
(
self
):
response
=
self
.
client
.
post
(
'http://testserver/api/workouts/'
,
json
.
dumps
(
defaultDataWorkout
),
content_type
=
'application/json'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_201_CREATED
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment