Add BaseAPITestCase class that invalidates the permission and smart settings caches.
Use BaseAPITestCase for all API test cases.
This commit is contained in:
17
mayan/apps/rest_api/tests/base.py
Normal file
17
mayan/apps/rest_api/tests/base.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from permissions.classes import Permission
|
||||
from smart_settings.classes import Namespace
|
||||
|
||||
|
||||
class BaseAPITestCase(APITestCase):
|
||||
"""
|
||||
API test case class that invalidates permissions and smart settings
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(BaseAPITestCase, self).setUp()
|
||||
Namespace.invalidate_cache_all()
|
||||
Permission.invalidate_cache()
|
||||
Reference in New Issue
Block a user