コード例 #1
0
    def test_develop_theme(self):
        ''' Check if the rules are developed
        '''
        # First we check the status of our environment variables
        var_name = 'DIAZO_ALWAYS_CACHE_RULES'
        env_had_var = var_name in environ
        # and clean it up
        env_var_backup = environ.pop(var_name, None)

        transform = ThemeTransform(None, {})
        # This evaluates to True because we set
        # getConfiguration().debug_mode to True in the test setup
        self.assertTrue(transform.develop_theme())

        # But we can anyway force the cache
        environ[var_name] = 'true'
        self.assertFalse(transform.develop_theme())

        # If we require to debug.diazo the variable will be ignored
        transform = ThemeTransform(None, {'diazo.debug': '1'})
        self.assertTrue(transform.develop_theme())

        # Then we reset our env variables before leaving
        if env_had_var:
            environ[var_name] = env_var_backup
        else:
            del environ[var_name]
コード例 #2
0
    def test_develop_theme(self):
        ''' Check if the rules are developed
        '''
        # First we check the status of our environment variables
        var_name = 'DIAZO_ALWAYS_CACHE_RULES'
        env_had_var = var_name in environ
        # and clean it up
        env_var_backup = environ.pop(var_name, None)

        transform = ThemeTransform(None, {})
        # This evaluates to True because we set
        # getConfiguration().debug_mode to True in the test setup
        self.assertTrue(transform.develop_theme())

        # But we can anyway force the cache
        environ[var_name] = 'true'
        self.assertFalse(transform.develop_theme())

        # If we require to debug.diazo the variable will be ignored
        transform = ThemeTransform(None, {'diazo.debug': '1'})
        self.assertTrue(transform.develop_theme())

        # Then we reset our env variables before leaving
        if env_had_var:
            environ[var_name] = env_var_backup
        else:
            del environ[var_name]
コード例 #3
0
    def test_develop_theme(self):
        ''' Check if the rules are developed
        '''
        # First we check the status of our environment variables
        var_name = 'DIAZO_ALWAYS_CACHE_RULES'
        env_had_var = var_name in environ
        # and clean it up
        env_var_backup = environ.pop(var_name, None)

        transform = ThemeTransform(None, None)
        # This evaluates to True because we set
        # Globals.DevelopmentMode to True in the test setup
        self.assertTrue(transform.develop_theme())

        # But we can anyway force the cache
        environ[var_name] = 'true'
        self.assertFalse(transform.develop_theme())

        # Then we reset our env variables before leaving
        if env_had_var:
            environ[var_name] = env_var_backup
        else:
            del environ[var_name]