This commit is contained in:
Dylan Castillo 2024-04-04 08:29:26 +02:00 committed by GitHub
parent 84db2b7314
commit 0f278f3c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View file

@ -17,4 +17,19 @@ class ValidateWrongContextBehaviorValueTestCase(SimpleTestCase):
from django_components.app_settings import app_settings
with self.assertRaises(ValueError):
app_settings.CONTEXT_BEHAVIOR.value
app_settings.CONTEXT_BEHAVIOR
class ValidateCorrectContextBehaviorValueTestCase(SimpleTestCase):
def setUp(self) -> None:
settings.COMPONENTS["context_behavior"] = "isolated"
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
self.assertEqual(app_settings.CONTEXT_BEHAVIOR, "isolated")