Add test for GitLab issue #702

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-12-08 14:34:54 -04:00
parent 948445c5d0
commit 242a5c1d41
2 changed files with 32 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
- Update devpi-server version to 5.3.1.
- Add targets to run staging containers using RabbitMQ as
broker.
- Add test for GitLab issue #702
3.3.3 (2019-12-05)
==================

View File

@@ -23,7 +23,37 @@ from .mocks import (
)
class ClassesTestCase(EnvironmentTestCaseMixin, SmartSettingTestMixin, BaseTestCase):
class ClassesTestCase(
EnvironmentTestCaseMixin, SmartSettingTestMixin, BaseTestCase
):
def test_environment_override(self):
test_environment_value = 'test environment value'
test_file_value = 'test file value'
self._create_test_settings_namespace()
self._create_test_setting()
self._set_environment_variable(
name='MAYAN_{}'.format(TEST_SETTING_GLOBAL_NAME),
value=test_environment_value
)
with NamedTemporaryFile() as file_object:
settings.CONFIGURATION_FILEPATH = file_object.name
file_object.write(
force_bytes(
'{}: {}'.format(
TEST_SETTING_GLOBAL_NAME, test_file_value
)
)
)
file_object.seek(0)
Setting._config_file_cache = None
self.assertEqual(
self.test_setting.value, test_environment_value
)
def test_environment_variable(self):
self._set_environment_variable(
name='MAYAN_{}'.format(ENVIRONMENT_TEST_NAME),