def test_delete_user_when_id_valid_should_delete_user_and_reply_204(self):
    initial_users_count = len(self.users)
    user_to_delete = self.users[0]
    request = self.factory.delete(reverse('v1:user-detail', kwargs={'pk': user_to_delete.pk}))
    user_detail_view = UserViewSet.as_view({'delete': 'destroy'})
    response = user_detail_view(request, pk=user_to_delete.pk)
    self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
    new_users_count = User.objects.count()
    self.assertEqual((initial_users_count - 1), new_users_count)
def test_delete_user_when_id_valid_should_delete_user_and_reply_204(self):
    initial_users_count = len(self.users)
    user_to_delete = self.users[0]
    request = self.factory.delete(reverse('v1:user-detail', kwargs={'pk': user_to_delete.pk}))
    user_detail_view = UserViewSet.as_view({'delete': 'destroy'})
    response = user_detail_view(request, pk=user_to_delete.pk)
    self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
    new_users_count = User.objects.count()
    self.assertEqual((initial_users_count - 1), new_users_count)