mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 06:18:17 +00:00
Add tests for base_dir str/path
This commit is contained in:
parent
d1224c13c9
commit
d2b3b79b52
1 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
from pathlib import Path
|
||||
from django.test import override_settings
|
||||
|
||||
from django_components.app_settings import app_settings
|
||||
|
@ -17,3 +18,11 @@ class SettingsTestCase(BaseTestCase):
|
|||
def test_raises_on_invalid_context_behavior(self):
|
||||
with self.assertRaises(ValueError):
|
||||
app_settings.CONTEXT_BEHAVIOR
|
||||
|
||||
@override_settings(BASE_DIR="base_dir")
|
||||
def test_works_when_base_dir_is_string(self):
|
||||
self.assertEqual(app_settings.DIRS, [Path("base_dir/components")])
|
||||
|
||||
@override_settings(BASE_DIR=Path("base_dir"))
|
||||
def test_works_when_base_dir_is_path(self):
|
||||
self.assertEqual(app_settings.DIRS, [Path("base_dir/components")])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue