from rest_framework import status from rest_framework.test import APIClient from apps.users.models import User def test_profile_picture_delete_returns_profile_payload(db): user = User.objects.create_user(mobile="09120000000", password="secret123") client = APIClient() client.force_authenticate(user=user) response = client.delete("/api/users/profile/picture/") assert response.status_code == status.HTTP_200_OK assert response.data["profile_picture"] is None user.refresh_from_db() assert not user.profile_picture