mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
fix tests and formatting
This commit is contained in:
parent
56a062d01f
commit
123628c66a
4 changed files with 9 additions and 6 deletions
|
@ -540,7 +540,12 @@ async def sign_and_send(
|
|||
|
||||
digest = make_digest(data)
|
||||
signature = make_signature(
|
||||
"post", sender, destination, now, digest=digest, use_legacy_key=kwargs.get("use_legacy_key")
|
||||
"post",
|
||||
sender,
|
||||
destination,
|
||||
now,
|
||||
digest=digest,
|
||||
use_legacy_key=kwargs.get("use_legacy_key"),
|
||||
)
|
||||
|
||||
headers = {
|
||||
|
|
|
@ -22,9 +22,7 @@ def create_key_pair():
|
|||
return private_key, public_key
|
||||
|
||||
|
||||
def make_signature(
|
||||
method, sender, destination, date, **kwargs
|
||||
):
|
||||
def make_signature(method, sender, destination, date, **kwargs):
|
||||
"""uses a private key to sign an outgoing message"""
|
||||
inbox_parts = urlparse(destination)
|
||||
signature_headers = [
|
||||
|
|
|
@ -404,7 +404,7 @@ class ModelFields(TestCase):
|
|||
self.assertIsInstance(result, list)
|
||||
self.assertEqual(len(result), 1)
|
||||
self.assertEqual(result[0].href, "https://e.b/c")
|
||||
self.assertEqual(result[0].name, "Name")
|
||||
self.assertEqual(result[0].name, "@Name")
|
||||
self.assertEqual(result[0].type, "Serializable")
|
||||
|
||||
def test_tag_field_from_activity(self, *_):
|
||||
|
|
|
@ -87,7 +87,7 @@ class Signature(TestCase):
|
|||
data = json.dumps(get_follow_activity(sender, self.rat))
|
||||
digest = digest or make_digest(data)
|
||||
signature = make_signature(
|
||||
"post", signer or sender, self.rat.inbox, now, digest
|
||||
"post", signer or sender, self.rat.inbox, now, digest=digest
|
||||
)
|
||||
with patch("bookwyrm.views.inbox.activity_task.apply_async"):
|
||||
with patch("bookwyrm.models.user.set_remote_server.delay"):
|
||||
|
|
Loading…
Reference in a new issue