Verified Commit 3ffc3a5a authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

dm: decode bytestring



Thanks: Alexandre Detiste <alexandre.detiste@gmail.com> for reporting
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 373363f1
Pipeline #422024 passed with stage
in 5 minutes and 30 seconds
...@@ -71,7 +71,7 @@ class TestClaim(PersonFixtureMixin, TestCase): ...@@ -71,7 +71,7 @@ class TestClaim(PersonFixtureMixin, TestCase):
# Get and return the confirmation url from the result # Get and return the confirmation url from the result
self.assertIn("/dm/claim/confirm", response.context["plaintext"]) self.assertIn("/dm/claim/confirm", response.context["plaintext"])
self.assertIn(b"-----BEGIN PGP MESSAGE-----", response.context["challenge"]) self.assertIn("-----BEGIN PGP MESSAGE-----", response.context["challenge"])
return identity, response.context["plaintext"].strip() return identity, response.context["plaintext"].strip()
def _test_success(self, person, issuer): def _test_success(self, person, issuer):
......
...@@ -104,7 +104,7 @@ class Claim(VisitorMixin, FormView): ...@@ -104,7 +104,7 @@ class Claim(VisitorMixin, FormView):
# by unit tests without the need to have access to the private key # by unit tests without the need to have access to the private key
# to decode it # to decode it
ctx["plaintext"] = plaintext ctx["plaintext"] = plaintext
ctx["challenge"] = key.encrypt(plaintext.encode("utf8")) ctx["challenge"] = key.encrypt(plaintext.encode("utf8")).decode("utf8")
return ctx return ctx
def form_valid(self, form): def form_valid(self, form):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment