diff --git a/dm/tests/test_claim.py b/dm/tests/test_claim.py index 168bb79fd4f9243b8d89ba516934341ae305b2bc..652336c4e320ec01a28f7715f46ce01295fcc76b 100644 --- a/dm/tests/test_claim.py +++ b/dm/tests/test_claim.py @@ -71,7 +71,7 @@ class TestClaim(PersonFixtureMixin, TestCase): # Get and return the confirmation url from the result 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() def _test_success(self, person, issuer): diff --git a/dm/views.py b/dm/views.py index 3f6278046fd848b08a93bb0311d3dbc745da018f..ea13ce79ac8f8c8e6af309e3d68560e6cb5f062c 100644 --- a/dm/views.py +++ b/dm/views.py @@ -104,7 +104,7 @@ class Claim(VisitorMixin, FormView): # by unit tests without the need to have access to the private key # to decode it ctx["plaintext"] = plaintext - ctx["challenge"] = key.encrypt(plaintext.encode("utf8")) + ctx["challenge"] = key.encrypt(plaintext.encode("utf8")).decode("utf8") return ctx def form_valid(self, form):