Commit e080ae2f authored by Jérome Perrin's avatar Jérome Perrin

patches/Restricted: allow random.SystemRandom

parent f1bbc5aa
......@@ -325,3 +325,6 @@ for member_id in dir(decimal):
if isinstance(member, type) and issubclass(member, decimal.DecimalException):
ContainerAssertions[member] = 1
del member_id, member
from random import SystemRandom
allow_type(SystemRandom)
......@@ -91,6 +91,10 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase):
self.createAndRunScript('import decimal',
'return decimal.Decimal.from_float(3.3)')
def testSystemRandom(self):
self.createAndRunScript('import random',
'return random.SystemRandom().getrandbits(10)')
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestRestrictedPythonSecurity))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment