From ea636aac7e9db4b0fba60c973d6b001191dc4548 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 20 Jun 2017 01:35:12 -0400 Subject: [PATCH] Add test for the setting environment support. Signed-off-by: Roberto Rosario --- mayan/apps/smart_settings/tests/literals.py | 4 ++++ mayan/apps/smart_settings/tests/test_classes.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 mayan/apps/smart_settings/tests/literals.py create mode 100644 mayan/apps/smart_settings/tests/test_classes.py diff --git a/mayan/apps/smart_settings/tests/literals.py b/mayan/apps/smart_settings/tests/literals.py new file mode 100644 index 0000000000..381ddaaef2 --- /dev/null +++ b/mayan/apps/smart_settings/tests/literals.py @@ -0,0 +1,4 @@ +from __future__ import unicode_literals + +ENVIRONMENT_TEST_NAME = 'PAGINATE_BY' +ENVIRONMENT_TEST_VALUE = '999999' diff --git a/mayan/apps/smart_settings/tests/test_classes.py b/mayan/apps/smart_settings/tests/test_classes.py new file mode 100644 index 0000000000..00fa74daa8 --- /dev/null +++ b/mayan/apps/smart_settings/tests/test_classes.py @@ -0,0 +1,16 @@ +from __future__ import absolute_import, unicode_literals + +import os + +from common.settings import setting_paginate_by +from common.tests import BaseTestCase + +from .literals import ENVIRONMENT_TEST_NAME, ENVIRONMENT_TEST_VALUE + + +class ClassesTestCase(BaseTestCase): + def test_environment_variable(self): + os.environ[ + 'MAYAN_{}'.format(ENVIRONMENT_TEST_NAME) + ] = ENVIRONMENT_TEST_VALUE + self.assertTrue(setting_paginate_by.value, ENVIRONMENT_TEST_VALUE)