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