예제 #1
0
    def test_cms_templates_valid(self):
        '''
        These are all formats that should be valid, thus return nothing when DEBUG is True.
        '''
        success_template_tests = (
            # one valid template
            (('col_two.html', 'two columns'),),

            # two valid templates
            (('col_two.html', 'two columns'),
             ('col_three.html', 'three columns'),),

            # three valid templates
            (('col_two.html', 'two columns'),
             ('col_three.html', 'three columns'),
             ('nav_playground.html', 'navigation examples'),),

            # three valid templates + inheritance
            (('col_two.html', 'two columns'),
             ('col_three.html', 'three columns'),
             ('nav_playground.html', 'navigation examples'),
             (CMS_TEMPLATE_INHERITANCE_MAGIC, None),),

            # same valid templates as above, ensuring we don't short circuit when inheritance
            # magic comes first.
            ((CMS_TEMPLATE_INHERITANCE_MAGIC, None),
             ('col_two.html', 'two columns'),
             ('col_three.html', 'three columns'),
             ('nav_playground.html', 'navigation examples'),),
        )
        for value_to_test in success_template_tests:
            with SettingsOverride(DEBUG=True, CMS_TEMPLATES=value_to_test):
                self.assertEqual(None, post_patch_check())
예제 #2
0
    def test_cms_templates_valid(self):
        '''
        These are all formats that should be valid, thus return nothing when DEBUG is True.
        '''
        success_template_tests = (
            # one valid template
            (
                ('col_two.html', 'two columns'), ),

            # two valid templates
            (
                ('col_two.html', 'two columns'),
                ('col_three.html', 'three columns'),
            ),

            # three valid templates
            (
                ('col_two.html', 'two columns'),
                ('col_three.html', 'three columns'),
                ('nav_playground.html', 'navigation examples'),
            ),

            # three valid templates + inheritance
            (
                ('col_two.html', 'two columns'),
                ('col_three.html', 'three columns'),
                ('nav_playground.html', 'navigation examples'),
                (CMS_TEMPLATE_INHERITANCE_MAGIC, None),
            ),

            # same valid templates as above, ensuring we don't short circuit when inheritance
            # magic comes first.
            (
                (CMS_TEMPLATE_INHERITANCE_MAGIC, None),
                ('col_two.html', 'two columns'),
                ('col_three.html', 'three columns'),
                ('nav_playground.html', 'navigation examples'),
            ),
        )
        for value_to_test in success_template_tests:
            with SettingsOverride(DEBUG=True, CMS_TEMPLATES=value_to_test):
                self.assertEqual(None, post_patch_check())
예제 #3
0
 def test_post_patch_check(self):
     post_patch_check()