From 653f55f84a67fa0f8765934da8f8e323eb5e0a3f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Oct 2019 09:43:10 -0400 Subject: [PATCH] Invalidate the layer cache in tests Signed-off-by: Roberto Rosario --- mayan/apps/common/tests/base.py | 3 ++- mayan/apps/converter/tests/mixins.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mayan/apps/common/tests/base.py b/mayan/apps/common/tests/base.py index 3c352df9df..81802e63e7 100644 --- a/mayan/apps/common/tests/base.py +++ b/mayan/apps/common/tests/base.py @@ -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 diff --git a/mayan/apps/converter/tests/mixins.py b/mayan/apps/converter/tests/mixins.py index b5a914a232..7fffc10f4d 100644 --- a/mayan/apps/converter/tests/mixins.py +++ b/mayan/apps/converter/tests/mixins.py @@ -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):