requires needs force_permissive
This commit is contained in:
parent
790115c919
commit
95849d2e01
|
@ -301,6 +301,23 @@ def test_requires_transitive_bis():
|
||||||
assert frozenset(props) == frozenset(['disabled'])
|
assert frozenset(props) == frozenset(['disabled'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_requires_transitive_hidden_permissive():
|
||||||
|
a = BoolOption('activate_service', '', True)
|
||||||
|
b = BoolOption('activate_service_web', '', True,
|
||||||
|
requires=[{'option': a, 'expected': False, 'action': 'hidden'}])
|
||||||
|
d = IPOption('ip_address_service_web', '',
|
||||||
|
requires=[{'option': b, 'expected': False, 'action': 'disabled'}])
|
||||||
|
od = OptionDescription('service', '', [a, b, d])
|
||||||
|
api = getapi(Config(od))
|
||||||
|
api.property.read_write()
|
||||||
|
api.option('activate_service').value.get()
|
||||||
|
api.option('ip_address_service_web').value.get()
|
||||||
|
api.option('ip_address_service_web').value.get()
|
||||||
|
api.option('activate_service').value.set(False)
|
||||||
|
#
|
||||||
|
api.option('ip_address_service_web').value.get()
|
||||||
|
|
||||||
|
|
||||||
def test_requires_transitive_hidden_disabled():
|
def test_requires_transitive_hidden_disabled():
|
||||||
a = BoolOption('activate_service', '', True)
|
a = BoolOption('activate_service', '', True)
|
||||||
b = BoolOption('activate_service_web', '', True,
|
b = BoolOption('activate_service_web', '', True,
|
||||||
|
|
|
@ -486,6 +486,7 @@ class Settings(object):
|
||||||
is_indexed = True
|
is_indexed = True
|
||||||
sconfig_bag = config_bag.copy('nooption')
|
sconfig_bag = config_bag.copy('nooption')
|
||||||
sconfig_bag.option = option
|
sconfig_bag.option = option
|
||||||
|
sconfig_bag.force_permissive = True
|
||||||
try:
|
try:
|
||||||
value = context.getattr(reqpath,
|
value = context.getattr(reqpath,
|
||||||
idx,
|
idx,
|
||||||
|
|
Loading…
Reference in New Issue