mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #30057 -- Added more diffsettings tests.
The test in 573f44d62f doesn't act as a
regression test.
This commit is contained in:
20
tests/admin_scripts/configured_dynamic_settings_manage.py
Normal file
20
tests/admin_scripts/configured_dynamic_settings_manage.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
from django.conf import global_settings, settings
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
|
||||
class Settings:
|
||||
def __getattr__(self, name):
|
||||
if name == 'FOO':
|
||||
return 'bar'
|
||||
return getattr(global_settings, name)
|
||||
|
||||
def __dir__(self):
|
||||
return super().__dir__() + dir(global_settings) + ['FOO']
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
settings.configure(Settings())
|
||||
execute_from_command_line(sys.argv)
|
||||
Reference in New Issue
Block a user