-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
Checklist
- Raised initially as discussion #...
- This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case.
I've been trying to implement a test in a view where my permission_class is (IsAuthenticated) but when I use force_authenticated(request,user=user) it still gives me 401 unauthorized. My testcase:
def test_final_result(self):
user = User.objects.get(username='test1')
story_id = Story.objects.get(storyName='testplanning').id
room_id = PokerRoom.objects.get(name='planning').id
request = self.client.post(reverse('finalvotes', kwargs={'pk': room_id, 'idStory': story_id}), {'finalResult': '2'}, format='json')
force_authenticate(request, user=user)
self.assertEqual(200,request.status_code)
Metadata
Metadata
Assignees
Labels
No labels