Blacked the code

This commit is contained in:
Eliot Berriot 2018-06-09 15:36:16 +02:00
parent b6fc0051fa
commit 62ca3bd736
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
279 changed files with 8861 additions and 9527 deletions

View file

@ -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)