mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-04-29 11:04:47 +00:00
18 lines
515 B
Python
18 lines
515 B
Python
from django.utils import unittest
|
|
from django.test.client import RequestFactory
|
|
|
|
|
|
from djadmin2 import apiviews
|
|
from ..models import Post
|
|
|
|
|
|
class ViewTest(unittest.TestCase):
|
|
def setUp(self):
|
|
self.factory = RequestFactory()
|
|
|
|
|
|
class IndexViewModelListCreateAPIViewTest(ViewTest):
|
|
def test_response_ok(self):
|
|
request = self.factory.get('/admin/api/blog/post/')
|
|
response = apiviews.ModelListCreateAPIView.as_view(model=Post)(request)
|
|
self.assertEqual(response.status_code, 200)
|