Files
mayan-edms/mayan/apps/rest_api/tests/base.py
Roberto Rosario 05ceeca8ff Allow multitle expected_content_types in tests
Some tests return 'text/html' or 'text/html; charset=utf-8'
which are essentially the same if they are tested in debug mode.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-11-11 18:37:32 -04:00

20 lines
596 B
Python

from __future__ import absolute_import, unicode_literals
from rest_framework.test import APITestCase
from mayan.apps.common.tests import GenericViewTestCase
from mayan.apps.permissions.classes import Permission
from mayan.apps.smart_settings.classes import Namespace
class BaseAPITestCase(APITestCase, GenericViewTestCase):
"""
API test case class that invalidates permissions and smart settings
"""
expected_content_types = None
def setUp(self):
super(BaseAPITestCase, self).setUp()
Namespace.invalidate_cache_all()
Permission.invalidate_cache()