Skip to content

Commit fb44581

Browse files
Use random password instead of hard coded password as a security measure.
1 parent 4ed95aa commit fb44581

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/Connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import cx_Oracle
1515
import random
16+
import string
1617
import threading
1718

1819
class TestCase(TestEnv.BaseTestCase):
@@ -127,7 +128,9 @@ def testBadPassword(self):
127128

128129
def testChangePassword(self):
129130
"test changing password"
130-
newPassword = "NEW_PASSWORD"
131+
sysRandom = random.SystemRandom()
132+
newPassword = "".join(sysRandom.choice(string.ascii_letters) \
133+
for i in range(20))
131134
connection = TestEnv.GetConnection()
132135
connection.changepassword(TestEnv.GetMainPassword(), newPassword)
133136
cconnection = cx_Oracle.connect(TestEnv.GetMainUser(), newPassword,

0 commit comments

Comments
 (0)