Commit ae3a05aa authored by Tomas Vaagen Gule's avatar Tomas Vaagen Gule
Browse files

#10 Update tests

parent 9cf896fb
......@@ -47,6 +47,8 @@ class WorkoutPermissionTestCase(TestCase):
self.factory = APIRequestFactory()
self.request = self.factory.get('/workout/1/')
def test_is_owner(self):
request = self.factory.get('/workout/1/')
......@@ -92,7 +94,4 @@ class WorkoutPermissionTestCase(TestCase):
self.assertTrue(IsWorkoutPublic.has_object_permission(IsWorkoutPublic, view ="", request=request, obj=self.workoutFile))
def test_is_read_only(self):
workoutFile = WorkoutFile.objects.create(owner=self.user, workout=self.workout, file="")
request = self.factory.get('/workout/1/')
IsReadOnly.has_object_permission(IsReadOnly, view ="", request=request, obj=workoutFile)
\ No newline at end of file
self.assertTrue(IsReadOnly.has_object_permission(IsReadOnly, view ="", request=self.request, obj=self.workoutFile))
\ No newline at end of file
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