コード例 #1
0
ファイル: test_database.py プロジェクト: MakeHer/edx-platform
 def test_microsite_get_template(self):
     """
     Test microsite.get_template return appropriate template.
     """
     microsite.set_by_domain(self.microsite.site.domain)
     template = microsite.get_template('about.html')
     self.assertIn('About this microsite', template.render())
コード例 #2
0
 def test_microsite_get_template(self):
     """
     Test microsite.get_template return appropriate template.
     """
     microsite.set_by_domain(self.microsite.site.domain)
     template = microsite.get_template('about.html')
     self.assertIn('About this microsite', template.render())
コード例 #3
0
 def test_microsite_get_template_when_no_template_exists(self):
     """
     Test microsite.get_template return None if there is not template in DB.
     """
     MicrositeTemplate.objects.all().delete()
     microsite.set_by_domain(self.microsite.site.domain)
     template = microsite.get_template('about.html')
     self.assertIsNone(template)
コード例 #4
0
ファイル: test_database.py プロジェクト: MakeHer/edx-platform
 def test_microsite_get_template_when_no_template_exists(self):
     """
     Test microsite.get_template return None if there is not template in DB.
     """
     MicrositeTemplate.objects.all().delete()
     microsite.set_by_domain(self.microsite.site.domain)
     template = microsite.get_template('about.html')
     self.assertIsNone(template)
コード例 #5
0
ファイル: helpers.py プロジェクト: bryanlandia/edx-platform
def get_template(uri):
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    :param uri: uri of the template
    """
    # We need to give priority to theming over microsites
    # So, we apply microsite template override only when there is no associated theme,
    if not current_request_has_associated_site_theme():
        return microsite.get_template(uri)
コード例 #6
0
def get_template(uri):
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    :param uri: uri of the template
    """
    # We need to give priority to theming over microsites
    # So, we apply microsite template override only when there is no associated theme,
    if not current_request_has_associated_site_theme():
        return microsite.get_template(uri)
コード例 #7
0
ファイル: paths.py プロジェクト: devs1991/test_edx_docmode
    def get_template(self, uri):
        """
        Overridden method which will hand-off the template lookup to the microsite subsystem
        """
        microsite_template = microsite.get_template(uri)

        return (
            microsite_template
            if microsite_template
            else super(DynamicTemplateLookup, self).get_template(uri)
        )
コード例 #8
0
ファイル: helpers.py プロジェクト: JioEducation/edx-platform
def get_template(uri):
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    :param uri: uri of the template
    """
    return microsite.get_template(uri)
コード例 #9
0
ファイル: helpers.py プロジェクト: shabab12/edx-platform
def get_template(uri):
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    :param uri: uri of the template
    """
    return microsite.get_template(uri)