def test_deprecated_blocks_file_and_config(self):
        """
        Tests that deprecated types defined in both settings and config model are read.
        """
        XBlockDisableConfig.objects.create(
            disabled_create_blocks='annotatable', enabled=True)

        self.assertEqual(XBlockDisableConfig.disabled_create_block_types(),
                         ['annotatable', 'poll', 'survey'])
    def test_deprecated_blocks_splitting(self, xblocks, expected_result):
        """
        Tests that it correctly splits the xblocks defined in field.
        """
        XBlockDisableConfig.objects.create(disabled_create_blocks=xblocks,
                                           enabled=True)

        self.assertEqual(XBlockDisableConfig.disabled_create_block_types(),
                         expected_result)
Exemple #3
0
def _advanced_component_types():
    """
    Return advanced component types which can be created.
    """
    disabled_create_block_types = XBlockDisableConfig.disabled_create_block_types(
    )
    return [
        c_type for c_type in ADVANCED_COMPONENT_TYPES
        if c_type not in disabled_create_block_types
    ]
Exemple #4
0
def _advanced_component_types():
    """
    Return advanced component types which can be created.
    """
    disabled_create_block_types = XBlockDisableConfig.disabled_create_block_types()
    return [c_type for c_type in ADVANCED_COMPONENT_TYPES if c_type not in disabled_create_block_types]
 def test_deprecated_blocks_file(self):
     """
     Tests that deprecated modules contain entries from settings file DEPRECATED_ADVANCED_COMPONENT_TYPES
     """
     self.assertEqual(XBlockDisableConfig.disabled_create_block_types(),
                      ['poll', 'survey'])