mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 21:12:11 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -8,34 +8,29 @@ from funkwhale_api.federation import serializers
|
|||
|
||||
|
||||
def test_cannot_duplicate_actor(factories):
|
||||
actor = factories['federation.Actor']()
|
||||
actor = factories["federation.Actor"]()
|
||||
|
||||
with pytest.raises(db.IntegrityError):
|
||||
factories['federation.Actor'](
|
||||
domain=actor.domain,
|
||||
preferred_username=actor.preferred_username,
|
||||
factories["federation.Actor"](
|
||||
domain=actor.domain, preferred_username=actor.preferred_username
|
||||
)
|
||||
|
||||
|
||||
def test_cannot_duplicate_follow(factories):
|
||||
follow = factories['federation.Follow']()
|
||||
follow = factories["federation.Follow"]()
|
||||
|
||||
with pytest.raises(db.IntegrityError):
|
||||
factories['federation.Follow'](
|
||||
target=follow.target,
|
||||
actor=follow.actor,
|
||||
)
|
||||
factories["federation.Follow"](target=follow.target, actor=follow.actor)
|
||||
|
||||
|
||||
def test_follow_federation_url(factories):
|
||||
follow = factories['federation.Follow'](local=True)
|
||||
expected = '{}#follows/{}'.format(
|
||||
follow.actor.url, follow.uuid)
|
||||
follow = factories["federation.Follow"](local=True)
|
||||
expected = "{}#follows/{}".format(follow.actor.url, follow.uuid)
|
||||
|
||||
assert follow.get_federation_url() == expected
|
||||
|
||||
|
||||
def test_library_model_unique_per_actor(factories):
|
||||
library = factories['federation.Library']()
|
||||
library = factories["federation.Library"]()
|
||||
with pytest.raises(db.IntegrityError):
|
||||
factories['federation.Library'](actor=library.actor)
|
||||
factories["federation.Library"](actor=library.actor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue