def test_put_when_invalid_data_should_not_update_user_and_reply_400(self):
    riri = User.objects.create(first_name='Riri', last_name='Duck', email='example@example.com', password='dummy')
    invalid_payload = {'first_name': '', 'last_name': 'Duck', 'email': 'example@example.com'}
    request = self.factory.put(reverse('v1:user-detail', kwargs={'pk': riri.pk}), data=invalid_payload)
    user_detail_view = UserViewSet.as_view({'put': 'update'})
    response = user_detail_view(request, pk=riri.pk)
    self.assertEqual(status.HTTP_400_BAD_REQUEST, response.status_code)
def test_put_when_invalid_data_should_not_update_user_and_reply_400(self):
    riri = User.objects.create(first_name='Riri', last_name='Duck', email='example@example.com', password='dummy')
    invalid_payload = {'first_name': , 'last_name': 'Duck', 'email': 'example@example.com'}
    request = self.factory.put(reverse('v1:user-detail', kwargs={'pk': riri.pk}), data=invalid_payload)
    user_detail_view = UserViewSet.as_view({'put': 'update'})
    response = user_detail_view(request, pk=riri.pk)
    self.assertEqual(status.HTTP_400_BAD_REQUEST, response.status_code)