from django.urls import reverse from rest_framework.test import APITestCase class PodcastURLResolutionTests(APITestCase): """ Test suite to ensure all podcast API endpoints resolve and execute cleanly. """ def test_category_list_endpoint(self): """Test podcast categories endpoint is accessible""" url = reverse('podcast:category-list') response = self.client.get(url) self.assertLess(response.status_code, 500) def test_pinned_collection_list_endpoint(self): """Test podcast pinned collections endpoint is accessible""" url = reverse('podcast:pinned-collection-list') response = self.client.get(url) self.assertLess(response.status_code, 500) def test_collection_list_endpoint(self): """Test podcast collections endpoint is accessible""" url = reverse('podcast:collection-list') response = self.client.get(url) self.assertLess(response.status_code, 500) def test_podcast_list_endpoint(self): """Test podcast list endpoint is accessible""" url = reverse('podcast:podcast-list') response = self.client.get(url) self.assertLess(response.status_code, 500) def test_podcast_detail_endpoint(self): """Test podcast detail endpoint is accessible (may return 404 if no data)""" url = reverse('podcast:podcast-detail', kwargs={'slug': 'test-podcast'}) response = self.client.get(url) self.assertLess(response.status_code, 500) def test_user_playlist_create_endpoint(self): """Test user playlist create endpoint is accessible (POST)""" url = reverse('podcast:user-playlist-create') response = self.client.post(url) self.assertLess(response.status_code, 500) def test_user_playlist_list_endpoint(self): """Test user playlist list endpoint is accessible""" url = reverse('podcast:user-playlist-list') response = self.client.get(url) self.assertLess(response.status_code, 500)