コード例 #1
0
    def css_dependencies():
        """
        Returns list of CSS files that this XBlock depends on.

        The helper function that it uses to obtain the list of CSS files
        works in conjunction with the Django pipeline to ensure that in development mode
        the files are loaded individually, but in production just the single bundle is loaded.
        """
        if get_language_bidi():
            return get_css_dependencies('style-inline-discussion-rtl')
        else:
            return get_css_dependencies('style-inline-discussion')
コード例 #2
0
    def css_dependencies():
        """
        Returns list of CSS files that this XBlock depends on.

        The helper function that it uses to obtain the list of CSS files
        works in conjunction with the Django pipeline to ensure that in development mode
        the files are loaded individually, but in production just the single bundle is loaded.
        """
        if get_language_bidi():
            return get_css_dependencies('style-inline-discussion-rtl')
        else:
            return get_css_dependencies('style-inline-discussion')
コード例 #3
0
 def test_get_css_dependencies(self, pipeline_enabled, expected_css_dependencies):
     """
     Verify that `get_css_dependencies` returns correct list of files.
     """
     pipeline_css = {
         'style-group': {
             'source_filenames': ["a.css", "b.css", "c.css"],
             'output_filename': "combined.css"
         }
     }
     with self.settings(PIPELINE_ENABLED=pipeline_enabled, PIPELINE_CSS=pipeline_css):
         css_dependencies = get_css_dependencies("style-group")
         self.assertEqual(css_dependencies, expected_css_dependencies)
コード例 #4
0
 def test_get_css_dependencies(self, pipeline_enabled,
                               expected_css_dependencies):
     """
     Verify that `get_css_dependencies` returns correct list of files.
     """
     pipeline_css = {
         'style-group': {
             'source_filenames': ["a.css", "b.css", "c.css"],
             'output_filename': "combined.css"
         }
     }
     with self.settings(PIPELINE_ENABLED=pipeline_enabled,
                        PIPELINE_CSS=pipeline_css):
         css_dependencies = get_css_dependencies("style-group")
         self.assertEqual(css_dependencies, expected_css_dependencies)
コード例 #5
0
 def test_get_css_dependencies(self, pipeline_enabled, expected_css_dependencies):
     """
     Verify that `get_css_dependencies` returns correct list of files.
     """
     pipeline = settings.PIPELINE.copy()
     pipeline['PIPELINE_ENABLED'] = pipeline_enabled
     pipeline['STYLESHEETS'] = {
         'style-group': {
             'source_filenames': ["a.css", "b.css", "c.css"],
             'output_filename': "combined.css"
         }
     }
     with self.settings(PIPELINE=pipeline):
         css_dependencies = get_css_dependencies("style-group")
         assert css_dependencies == expected_css_dependencies