Commit 798bb3b6 authored by Tomas Vaagen Gule's avatar Tomas Vaagen Gule
Browse files

#10 Update test

parent 80833d22
......@@ -58,8 +58,8 @@ class WorkoutPermissionTestCase(TestCase):
def test_owner_of_workout(self):
workoutFile = WorkoutFile.objects.create(owner=self.user, workout=self.workout, file="")
request_post = self.factory.post('/workout/1/', {'workout': 2}, format='json')
request_get = self.factory.get('/workout/1/', {'workout': 2}, format='json')
request_post = self.factory.post('/workout/1/', format='json')
request_get = self.factory.get('/workout/1/', format='json')
request_post.user=self.user
request_get.user=self.user
request_post.data={"workout": "/workoiut/1/"}
......@@ -68,6 +68,8 @@ class WorkoutPermissionTestCase(TestCase):
self.assertTrue(IsOwnerOfWorkout.has_object_permission(IsOwnerOfWorkout, view ="", request=request_post, obj=workoutFile))
self.assertTrue(IsOwnerOfWorkout.has_permission(IsOwnerOfWorkout, view ="", request=request_get))
self.assertTrue(IsOwnerOfWorkout.has_permission(IsOwnerOfWorkout, view ="", request=request_post))
request_post.data = {}
self.assertFalse(IsOwnerOfWorkout.has_permission(IsOwnerOfWorkout, view ="", request=request_post))
def test_is_coach_and_visible_to_coach(self):
request = self.factory.get('/workout/1/')
......
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