Skip to content

Commit 8f380df

Browse files
committed
Add config argument for one more call
Also added Mock so it gets tested.
1 parent 7784eb9 commit 8f380df

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

roundup/hyperdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def from_raw(self, value, **kw):
114114
return None
115115
try:
116116
return password.Password(encrypted=value, scheme=self.scheme,
117-
strict=True)
117+
strict=True,
118+
config=kw['db'].config)
118119
except password.PasswordValueError as message:
119120
raise HyperdbValueError(_('property %(property)s: %(errormsg)s') %
120121
{'property': kw['propname'],

test/test_hyperdbvals.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import unittest, os, shutil, errno, sys, difflib, cgi, re
1212
from hashlib import sha1
13+
from mock import Mock
1314

1415
from roundup import init, instance, password, hyperdb, date
1516

@@ -57,6 +58,7 @@ class TestDatabase:
5758
classes = {'test': TestClass(), 'test2': TestClass2()}
5859
def getUserTimezone(self):
5960
return 0
61+
config = Mock(PASSWORD_PBKDF2_DEFAULT_ROUNDS = 1000)
6062

6163
class RawToHyperdbTest(unittest.TestCase):
6264
def _test(self, propname, value, itemid=None):

0 commit comments

Comments
 (0)