Add trick to make tests pass on Django 1.11 too.

This commit is contained in:
Emil Stenström 2020-12-08 23:33:36 +01:00
parent ec7b10f4db
commit e9fba9538f
3 changed files with 9 additions and 3 deletions

View file

@ -1,10 +1,9 @@
from textwrap import dedent from textwrap import dedent
from django.test import SimpleTestCase
from django_components import component from django_components import component
from .django_test_setup import * # NOQA from .django_test_setup import * # NOQA
from .testutils import Django111CompatibleSimpleTestCase as SimpleTestCase
class ComponentRegistryTest(SimpleTestCase): class ComponentRegistryTest(SimpleTestCase):

View file

@ -1,11 +1,11 @@
from textwrap import dedent from textwrap import dedent
from django.template import Context, Template from django.template import Context, Template
from django.test import SimpleTestCase
from django_components import component from django_components import component
from .django_test_setup import * # NOQA from .django_test_setup import * # NOQA
from .testutils import Django111CompatibleSimpleTestCase as SimpleTestCase
class SimpleComponent(component.Component): class SimpleComponent(component.Component):

7
tests/testutils.py Normal file
View file

@ -0,0 +1,7 @@
from django.test import SimpleTestCase
class Django111CompatibleSimpleTestCase(SimpleTestCase):
def assertHTMLEqual(self, left, right):
left = left.replace(' type="text/javascript"', '')
super(Django111CompatibleSimpleTestCase, self).assertHTMLEqual(left, right)