Invalidate the layer cache in tests

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-10-08 09:43:10 -04:00
parent 9cf1d44ee7
commit 653f55f84a
2 changed files with 8 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ from django.test import TestCase
from django_downloadview import assert_download_response
from mayan.apps.acls.tests.mixins import ACLTestCaseMixin
from mayan.apps.converter.tests.mixins import LayerTestCaseMixin
from mayan.apps.permissions.classes import Permission
from mayan.apps.smart_settings.classes import Namespace
from mayan.apps.user_management.tests.mixins import UserTestMixin
@@ -19,7 +20,7 @@ from .mixins import (
class BaseTestCase(
SilenceLoggerTestCaseMixin, ConnectionsCheckTestCaseMixin,
LayerTestCaseMixin, SilenceLoggerTestCaseMixin, ConnectionsCheckTestCaseMixin,
RandomPrimaryKeyModelMonkeyPatchMixin, ACLTestCaseMixin,
ModelTestCaseMixin, OpenFileCheckTestCaseMixin,
TempfileCheckTestCasekMixin, UserTestMixin, TestCase

View File

@@ -14,6 +14,12 @@ from .literals import (
)
class LayerTestCaseMixin(object):
def setUp(self):
super(LayerTestCaseMixin, self).setUp()
Layer.invalidate_cache()
class LayerTestMixin(PermissionTestMixin):
test_layer = Layer(
label='Test layer', name='test_layer', order=1000,
@@ -38,8 +44,6 @@ class LayerTestMixin(PermissionTestMixin):
'select': self.test_layer_permission,
'view': self.test_layer_permission,
}
Layer.invalidate_cache()
Layer.update()
class TransformationTestMixin(LayerTestMixin):