def test_get_user_when_id_valid_should_retrieve_user_and_reply_200(self):
    riri = User.objects.create(first_name='Riri', last_name='Duck', email='example@example.com', password='dummy')
    user = User.objects.get(pk=riri.pk)
    request = self.factory.get(reverse('v1:user-detail', kwargs={'pk': riri.pk}))
    serializer = UserSerializer(user, context={'request': request})
    user_detail_view = UserViewSet.as_view({'get': 'retrieve'})
    response = user_detail_view(request, pk=riri.pk)
    self.assertEqual(serializer.data, response.data)
    self.assertEqual(status.HTTP_200_OK, response.status_code)
def test_get_user_when_id_valid_should_retrieve_user_and_reply_200(self):
    riri = User.objects.create(first_name='Riri', last_name='Duck', email='example@example.com', password='dummy')
    user = User.objects.get(pk=riri.pk)
    request = self.factory.get(reverse('v1:user-detail', kwargs={'pk': riri.pk}))
    serializer = UserSerializer(user, context={'request': request})
    user_detail_view = UserViewSet.as_view({'get': 'retrieve'})
    response = user_detail_view(request, pk=riri.pk)
    self.assertEqual(serializer.data, response.data)
    self.assertEqual(status.HTTP_200_OK, response.status_code)