You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
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)
|