示例#1
0
 def test_to_basic(self):
     field = ChallengeField('md5')
     assert field.to_basic(
         MockConfig(), DigestValue(b'salt', b'digest', hashlib.md5)) == {
             'salt': base64.b64encode(b'salt').decode(),
             'digest': base64.b64encode(b'digest').decode(),
         }
示例#2
0
 def test_to_basic_none(self):
     field = ChallengeField('md5')
     assert field.to_basic(None, None) is None
示例#3
0
 def test_to_basic_none(self):
     field = ChallengeField('md5')
     assert field.to_basic(MockConfig(), None) is None