Beispiel #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(),
         }
Beispiel #2
0
 def test_to_basic_none(self):
     field = ChallengeField('md5')
     assert field.to_basic(None, None) is None
Beispiel #3
0
 def test_to_basic_none(self):
     field = ChallengeField('md5')
     assert field.to_basic(MockConfig(), None) is None