mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
31 lines
856 B
Plaintext
31 lines
856 B
Plaintext
[case testParseSettingsFromFile]
|
|
from django.conf import settings
|
|
|
|
reveal_type(settings.ROOT_DIR) # E: Revealed type is 'builtins.str'
|
|
reveal_type(settings.OBJ) # E: Revealed type is 'django.utils.functional.LazyObject'
|
|
reveal_type(settings.NUMBERS) # E: Revealed type is 'builtins.list[Any]'
|
|
reveal_type(settings.DICT) # E: Revealed type is 'builtins.dict[Any, Any]'
|
|
|
|
[file mysettings.py]
|
|
SECRET_KEY = 112233
|
|
ROOT_DIR = '/etc'
|
|
NUMBERS = ['one', 'two']
|
|
DICT = {}
|
|
|
|
from django.utils.functional import LazyObject
|
|
OBJ = LazyObject()
|
|
|
|
[env DJANGO_SETTINGS_MODULE=mysettings]
|
|
[out]
|
|
|
|
[case testSettingIsInitializedToNone]
|
|
from django.conf import settings
|
|
|
|
reveal_type(settings.NONE_SETTING) # E: Revealed type is 'builtins.object'
|
|
|
|
[file mysettings_not_none.py]
|
|
SECRET_KEY = 112233
|
|
NONE_SETTING = None
|
|
|
|
[env DJANGO_SETTINGS_MODULE=mysettings_not_none]
|
|
[out] |