Save key pair when creating new User

This commit is contained in:
Mouse Reeve 2020-12-03 12:45:01 -08:00
parent a85043b351
commit 77a1fc26f1
2 changed files with 4 additions and 3 deletions

View file

@ -199,6 +199,7 @@ def execute_after_save(sender, instance, created, *args, **kwargs):
instance.key_pair = KeyPair.objects.create(
remote_id='%s/#main-key' % instance.remote_id)
instance.save()
shelves = [{
'name': 'To Read',

View file

@ -138,10 +138,10 @@ class Signature(TestCase):
)
# Second and subsequent fetches get a different key:
new_private_key, new_public_key = create_key_pair()
key_pair = KeyPair(*create_key_pair())
new_sender = Sender(
self.fake_remote.remote_id, new_private_key, new_public_key)
data['publicKey']['publicKeyPem'] = new_public_key
self.fake_remote.remote_id, key_pair)
data['publicKey']['publicKeyPem'] = key_pair.public_key
responses.add(
responses.GET,
self.fake_remote.remote_id,