feat: expand platform APIs, sources, and test coverage
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
This commit is contained in:
22
tests/apps/core/test_pagination.py
Normal file
22
tests/apps/core/test_pagination.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Tests for core pagination classes."""
|
||||
|
||||
from apps.core.pagination import StandardCursorPagination, StandardPagination
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
|
||||
class PaginationSchemaTest(SimpleTestCase):
|
||||
def test_standard_pagination_schema(self):
|
||||
schema = StandardPagination().get_paginated_response_schema({"type": "array"})
|
||||
|
||||
self.assertEqual(schema["type"], "object")
|
||||
self.assertEqual(schema["properties"]["data"]["type"], "array")
|
||||
|
||||
def test_cursor_pagination_schema(self):
|
||||
schema = StandardCursorPagination().get_paginated_response_schema(
|
||||
{"type": "array"}
|
||||
)
|
||||
|
||||
self.assertEqual(schema["type"], "object")
|
||||
pagination = schema["properties"]["meta"]["properties"]["pagination"]["properties"]
|
||||
self.assertIn("next_cursor", pagination)
|
||||
self.assertIn("previous_cursor", pagination)
|
||||
Reference in New Issue
Block a user