# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient


import unittest
import json
from .base import APITestCase
from django.conf import settings
        from wq.db.rest import router

    # Test existence and content of config.json
    def test_rest_config_json(self):
        response = self.client.get('/config.json')
        result = json.loads(response.content.decode('utf-8'))
        self.assertIn("pages", result)

        # Extra config
        self.assertIn("debug", result)

    def test_rest_index_json(self):
        result = router.get_index(None)
        self.assertIn("pages", result)
        self.assertIn("list", result["pages"][0])
        self.assertNotIn("list", result["pages"][-1])

    def test_rest_config_meta(self):
        conf = self.get_config('item')
        self.assertEqual({
            'name': 'item',
            'url': 'items',
            'list': True,
            'cache': 'none',
            'form': conf['form'],
            'label_template': '{{name}}',
            'verbose_name': 'item',
            'verbose_name_plural': 'items',
            'ordering': ['type', 'name'],
        }, conf)


# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient


# Path: tests/test_config.py
import unittest
import json
from .base import APITestCase
from django.conf import settings
        from wq.db.rest import router


    # Test existence and content of config.json
    def test_rest_config_json(self):
        response = self.client.get('/config.json')
        result = json.loads(response.content.decode('utf-8'))
        self.assertIn("pages", result)

        # Extra config
        self.assertIn("debug", result)

    def test_rest_index_json(self):
        result = router.get_index(None)
        self.assertIn("pages", result)
        self.assertIn("list", result["pages"][0])
        self.assertNotIn("list", result["pages"][-1])

    def test_rest_config_meta(self):
        conf = self.get_config('item')
        self.assertEqual({
            'name': 'item',
            'url': 'items',
            'list': True,
            'cache': 'none',
            'form': conf['form'],
            'label_template': '{{name}}',
            'verbose_name': 'item',
            'verbose_name_plural': 'items',
            'ordering': ['type', 'name'],
        }, conf)


    def test_rest_config_json_fields(self):