Commit 16f26def authored by Ramiro Morales's avatar Ramiro Morales Committed by Tim Graham
Browse files

Converted recently refactored templates tests to SimpleTestCase.

These test methods don't need DB setup/teardown.

Refs #23768 and b872134b.
parent 2cd19f37
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
from django.template.base import TemplateSyntaxError
from django.test import TestCase
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe

from .utils import render, setup, SafeClass, UnsafeClass


class AutoescapeTagTests(TestCase):
class AutoescapeTagTests(SimpleTestCase):

    @setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'})
    def test_autoescape_tag01(self):
+2 −2
Original line number Diff line number Diff line
from django.conf import settings
from django.template.base import Context, TemplateSyntaxError
from django.template.loader import get_template
from django.test import TestCase
from django.test import SimpleTestCase

from .utils import render, setup, SilentGetItemClass, SilentAttrClass, SomeClass

@@ -13,7 +13,7 @@ basic_templates = {
}


class BasicSyntaxTests(TestCase):
class BasicSyntaxTests(SimpleTestCase):

    @setup(basic_templates)
    def test_basic_syntax01(self):
+2 −2
Original line number Diff line number Diff line
from django.test import TestCase
from django.test import SimpleTestCase

from .utils import render, setup


class BuiltinsTests(TestCase):
class BuiltinsTests(SimpleTestCase):

    @setup({'builtins01': '{{ True }}'})
    def test_builtins01(self):
+2 −2
Original line number Diff line number Diff line
from django.core.cache import cache
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import TestCase
from django.test import SimpleTestCase

from .utils import render, setup


class CacheTagTests(TestCase):
class CacheTagTests(SimpleTestCase):

    def tearDown(self):
        cache.clear()
+2 −2
Original line number Diff line number Diff line
from django.test import TestCase
from django.test import SimpleTestCase

from .utils import render, setup


class CommentSyntaxTests(TestCase):
class CommentSyntaxTests(SimpleTestCase):

    @setup({'comment-syntax01': '{# this is hidden #}hello'})
    def test_comment_syntax01(self):
Loading