mirror of
https://github.com/django-components/django-components.git
synced 2025-09-27 07:59:08 +00:00
Move environment setup to the module to get Travis CI to pass.
This commit is contained in:
parent
48e6ea1e12
commit
41122d1592
1 changed files with 8 additions and 9 deletions
|
@ -4,6 +4,14 @@ import django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django_components import component
|
from django_components import component
|
||||||
|
|
||||||
|
settings.configure(
|
||||||
|
TEMPLATES=[{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': ["tests/templates/"],
|
||||||
|
}]
|
||||||
|
)
|
||||||
|
django.setup()
|
||||||
|
|
||||||
class SimpleComponent(component.Component):
|
class SimpleComponent(component.Component):
|
||||||
def context(self, variable=None):
|
def context(self, variable=None):
|
||||||
return {
|
return {
|
||||||
|
@ -16,15 +24,6 @@ class SimpleComponent(component.Component):
|
||||||
js = ("script.js",)
|
js = ("script.js",)
|
||||||
|
|
||||||
class ComponentRegistryTest(unittest.TestCase):
|
class ComponentRegistryTest(unittest.TestCase):
|
||||||
def setUp(self):
|
|
||||||
settings.configure(
|
|
||||||
TEMPLATES=[{
|
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
||||||
'DIRS': ["tests/templates/"],
|
|
||||||
}]
|
|
||||||
)
|
|
||||||
django.setup()
|
|
||||||
|
|
||||||
def test_simple_component(self):
|
def test_simple_component(self):
|
||||||
comp = SimpleComponent()
|
comp = SimpleComponent()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue