Files
mayan-edms/mayan/apps/documents/tests/test_setting_migrations.py
Roberto Rosario a7cf6b5664 Update migrations to accept migrated settings
- Unify all conditional YAML load under utils.smart_yaml_load.
- Update all setting migrations to use the smart setting test
  mixin to create the test config file.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-12-10 19:57:14 -04:00

56 lines
1.9 KiB
Python

from __future__ import unicode_literals
from mayan.apps.common.tests.base import BaseTestCase
from mayan.apps.smart_settings.tests.mixins import SmartSettingTestMixin
from ..settings import (
setting_documentimagecache_storage_arguments,
setting_storage_backend_arguments
)
class DocumentSettingMigrationTestCase(SmartSettingTestMixin, BaseTestCase):
def test_documents_storage_backend_arguments_0001(self):
test_value = {'location': 'test value'}
self.test_setting = setting_documentimagecache_storage_arguments
self.test_config_value = '{}'.format(test_value)
self._create_test_config_file()
self.assertEqual(
setting_documentimagecache_storage_arguments.value,
test_value
)
def test_documents_storage_backend_arguments_0001_with_dict(self):
test_value = {'location': 'test value'}
self.test_setting = setting_documentimagecache_storage_arguments
self.test_config_value = test_value
self._create_test_config_file()
self.assertEqual(
setting_documentimagecache_storage_arguments.value,
test_value
)
def test_documents_cache_storage_backend_arguments_0001(self):
test_value = {'location': 'test value'}
self.test_setting = setting_storage_backend_arguments
self.test_config_value = '{}'.format(test_value)
self._create_test_config_file()
self.assertEqual(
setting_storage_backend_arguments.value,
test_value
)
def test_documents_cache_storage_backend_arguments_0001_with_dict(self):
test_value = {'location': 'test value'}
self.test_setting = setting_storage_backend_arguments
self.test_config_value = test_value
self._create_test_config_file()
self.assertEqual(
setting_storage_backend_arguments.value,
test_value
)