def test_closest_secured_no_secured(self): parent = Mock(securedBy=None, parentResource=None) resource = Mock(securedBy=None, parentResource=parent) assert utils.closest_secured_by(resource) == []
def test_closest_secured_by_parent(self): parent = Mock(securedBy=['foo']) resource = Mock(securedBy=None, parentResource=parent) assert utils.closest_secured_by(resource) == ['foo']