def test_bool(self): os.environ["TEST_DATA"] = "1" self.assertTrue(get_env_bool("TEST_DATA")) os.environ["TEST_DATA"] = "True" self.assertTrue(get_env_bool("TEST_DATA")) os.environ["TEST_DATA"] = "true" self.assertTrue(get_env_bool("TEST_DATA")) os.environ["TEST_DATA"] = "Yes" self.assertTrue(get_env_bool("TEST_DATA")) os.environ["TEST_DATA"] = "no" self.assertFalse(get_env_bool("TEST_DATA")) os.environ["TEST_DATA"] = "0" self.assertFalse(get_env_bool("TEST_DATA")) del os.environ["TEST_DATA"] self.assertFalse(get_env_bool("TEST_DATA"))
def test_bool(self): os.environ["TEST_DATA"] = "1" self.assertEqual(get_env_bool("TEST_DATA"), True) os.environ["TEST_DATA"] = "True" self.assertEqual(get_env_bool("TEST_DATA"), True) os.environ["TEST_DATA"] = "true" self.assertEqual(get_env_bool("TEST_DATA"), True) os.environ["TEST_DATA"] = "Yes" self.assertEqual(get_env_bool("TEST_DATA"), True) os.environ["TEST_DATA"] = "no" self.assertEqual(get_env_bool("TEST_DATA"), False) os.environ["TEST_DATA"] = "0" self.assertEqual(get_env_bool("TEST_DATA"), False) del os.environ["TEST_DATA"] self.assertEqual(get_env_bool("TEST_DATA"), False)
def test_bool(self): os.environ['TEST_DATA'] = '1' self.assertEqual(get_env_bool('TEST_DATA'), True) os.environ['TEST_DATA'] = 'True' self.assertEqual(get_env_bool('TEST_DATA'), True) os.environ['TEST_DATA'] = 'true' self.assertEqual(get_env_bool('TEST_DATA'), True) os.environ['TEST_DATA'] = 'Yes' self.assertEqual(get_env_bool('TEST_DATA'), True) os.environ['TEST_DATA'] = 'no' self.assertEqual(get_env_bool('TEST_DATA'), False) os.environ['TEST_DATA'] = '0' self.assertEqual(get_env_bool('TEST_DATA'), False) del os.environ['TEST_DATA'] self.assertEqual(get_env_bool('TEST_DATA'), False)
from django.core.exceptions import PermissionDenied from django.http import Http404 from weblate.utils.environment import ( get_env_bool, get_env_int, get_env_list, get_env_map, modify_env_list, ) # # Django settings for Weblate project. # DEBUG = get_env_bool("WEBLATE_DEBUG", True) ADMINS = ((os.environ["WEBLATE_ADMIN_NAME"], os.environ["WEBLATE_ADMIN_EMAIL"]),) MANAGERS = ADMINS DATABASES = { "default": { # Use 'postgresql' or 'mysql'. "ENGINE": "django.db.backends.postgresql", # Database name. "NAME": os.environ["POSTGRES_DATABASE"], # Database user. "USER": os.environ["POSTGRES_USER"], # Name of role to alter to set parameters in PostgreSQL, # use in case role name is different than user used for authentication.
from django.core.exceptions import PermissionDenied from django.http import Http404 from weblate.utils.environment import ( get_env_bool, get_env_list, get_env_map, modify_env_list, ) # # Django settings for Weblate project. # DEBUG = get_env_bool("WEBLATE_DEBUG", True) ADMINS = ((os.environ["WEBLATE_ADMIN_NAME"], os.environ["WEBLATE_ADMIN_EMAIL"]),) MANAGERS = ADMINS DATABASES = { "default": { # Use 'postgresql' or 'mysql'. "ENGINE": "django.db.backends.postgresql", # Database name. "NAME": os.environ["POSTGRES_DATABASE"], # Database user. "USER": os.environ["POSTGRES_USER"], # Database password. "PASSWORD": os.environ["POSTGRES_PASSWORD"],
# along with this program. If not, see <https://www.gnu.org/licenses/>. # from __future__ import unicode_literals import platform import os from logging.handlers import SysLogHandler from django.core.exceptions import PermissionDenied from django.http import Http404 from weblate.utils.environment import get_env_list, get_env_map, get_env_bool # # Django settings for Weblate project. # DEBUG = get_env_bool('WEBLATE_DEBUG', True) ADMINS = ((os.environ['WEBLATE_ADMIN_NAME'], os.environ['WEBLATE_ADMIN_EMAIL']), # ('Your Name', '*****@*****.**'), ) MANAGERS = ADMINS DATABASES = { 'default': { # Use 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.postgresql', # Database name or path to database file if using sqlite3. 'NAME': os.environ['POSTGRES_DATABASE'], # Use same database for tests (needed as Docker MySQL can
# along with this program. If not, see <https://www.gnu.org/licenses/>. # from __future__ import unicode_literals import platform import os from logging.handlers import SysLogHandler from django.core.exceptions import PermissionDenied from django.http import Http404 from weblate.utils.environment import get_env_list, get_env_map, get_env_bool, modify_env_list # # Django settings for Weblate project. # DEBUG = get_env_bool('WEBLATE_DEBUG', True) ADMINS = ((os.environ['WEBLATE_ADMIN_NAME'], os.environ['WEBLATE_ADMIN_EMAIL']), # ('Your Name', '*****@*****.**'), ) MANAGERS = ADMINS DATABASES = { 'default': { # Use 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.postgresql', # Database name or path to database file if using sqlite3. 'NAME': os.environ['POSTGRES_DATABASE'], # Use same database for tests (needed as Docker MySQL can