mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 14:28:18 +00:00
Change context behavior setting to enum
This commit is contained in:
parent
8971849922
commit
560b721523
5 changed files with 48 additions and 9 deletions
20
tests/test_settings.py
Normal file
20
tests/test_settings.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from .django_test_setup import * # NOQA
|
||||
from .testutils import Django30CompatibleSimpleTestCase as SimpleTestCase
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class ValidateWrongContextBehaviorValueTestCase(SimpleTestCase):
|
||||
def setUp(self) -> None:
|
||||
settings.COMPONENTS["context_behavior"] = "invalid_value"
|
||||
return super().setUp()
|
||||
|
||||
def tearDown(self) -> None:
|
||||
del settings.COMPONENTS["context_behavior"]
|
||||
return super().tearDown()
|
||||
|
||||
def test_valid_context_behavior(self):
|
||||
from django_components.app_settings import app_settings
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
app_settings.CONTEXT_BEHAVIOR.value
|
Loading…
Add table
Add a link
Reference in a new issue