def setUp(self): super(TestDerivedSettings, self).setUp() clear_for_tests() self.module = sys.modules[__name__] self.module.SIMPLE_VALUE = 'paneer' self.module.DERIVED_VALUE = lambda settings: 'mutter ' + settings.SIMPLE_VALUE self.module.ANOTHER_DERIVED_VALUE = lambda settings: settings.DERIVED_VALUE + ' with naan' self.module.UNREGISTERED_DERIVED_VALUE = lambda settings: settings.SIMPLE_VALUE + ' is cheese' derived('DERIVED_VALUE', 'ANOTHER_DERIVED_VALUE') self.module.DICT_VALUE = {} self.module.DICT_VALUE['test_key'] = lambda settings: settings.DERIVED_VALUE * 3 derived_collection_entry('DICT_VALUE', 'test_key') self.module.DICT_VALUE['list_key'] = ['not derived', lambda settings: settings.DERIVED_VALUE] derived_collection_entry('DICT_VALUE', 'list_key', 1)
def setUp(self): super(TestDerivedSettings, self).setUp() clear_for_tests() self.module = sys.modules[__name__] self.module.SIMPLE_VALUE = 'paneer' self.module.DERIVED_VALUE = lambda settings: 'mutter ' + settings.SIMPLE_VALUE self.module.ANOTHER_DERIVED_VALUE = lambda settings: settings.DERIVED_VALUE + ' with naan' self.module.UNREGISTERED_DERIVED_VALUE = lambda settings: settings.SIMPLE_VALUE + ' is cheese' derived('DERIVED_VALUE', 'ANOTHER_DERIVED_VALUE') self.module.DICT_VALUE = {} self.module.DICT_VALUE['test_key'] = lambda settings: settings.DERIVED_VALUE * 3 derived_collection_entry('DICT_VALUE', 'test_key') self.module.DICT_VALUE['list_key'] = ['not derived', lambda settings: settings.DERIVED_VALUE] derived_collection_entry('DICT_VALUE', 'list_key', 1)
} }, { # This separate copy of the Mako backend is used to render previews using the LMS templates 'NAME': 'preview', 'BACKEND': 'edxmako.backend.Mako', 'APP_DIRS': False, 'DIRS': lms.envs.common.MAKO_TEMPLATE_DIRS_BASE, 'OPTIONS': { 'context_processors': CONTEXT_PROCESSORS, 'debug': False, 'namespace': 'lms.main', } }, ] derived_collection_entry('TEMPLATES', 0, 'DIRS') derived_collection_entry('TEMPLATES', 1, 'DIRS') DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0] ############################################################################## EDX_ROOT_URL = '' LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/signin' LOGIN_URL = EDX_ROOT_URL + '/signin' # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = [ 'rules.permissions.ObjectPermissionBackend', 'ratelimitbackend.backends.RateLimitModelBackend', ]
} }, { # This separate copy of the Mako backend is used to render previews using the LMS templates 'NAME': 'preview', 'BACKEND': 'edxmako.backend.Mako', 'APP_DIRS': False, 'DIRS': lms.envs.common.MAKO_TEMPLATE_DIRS_BASE, 'OPTIONS': { 'context_processors': CONTEXT_PROCESSORS, 'debug': False, 'namespace': 'lms.main', } }, ] derived_collection_entry('TEMPLATES', 0, 'DIRS') derived_collection_entry('TEMPLATES', 1, 'DIRS') DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0] ############################################################################## EDX_ROOT_URL = '' LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/signin' LOGIN_URL = EDX_ROOT_URL + '/signin' # use the ratelimit backend to prevent brute force attacks AUTHENTICATION_BACKENDS = [ 'rules.permissions.ObjectPermissionBackend', 'ratelimitbackend.backends.RateLimitModelBackend', ]