[Neo-report] r2313 gregory - /trunk/neo/tests/__init__.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 24 10:25:08 CEST 2010


Author: gregory
Date: Fri Sep 24 10:25:07 2010
New Revision: 2313

Log:
Use random.randint instead of os.urandom

Modified:
    trunk/neo/tests/__init__.py

Modified: trunk/neo/tests/__init__.py
==============================================================================
--- trunk/neo/tests/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/__init__.py [iso-8859-1] Fri Sep 24 10:25:07 2010
@@ -16,6 +16,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 import os
+import random
 import unittest
 import tempfile
 import MySQLdb
@@ -134,7 +135,7 @@ class NeoTestBase(unittest.TestCase):
     def getPTID(self, i=None):
         """ Return an integer PTID """
         if i is None:
-            return os.unpack('!Q', os.urandom(8))[0]
+            return random.randint(1, 2**64)
         return i
 
     def getOID(self, i=None):





More information about the Neo-report mailing list