Verified Commit 438a1ec8 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

linting

parent e214d5c3
Pipeline #3934 passed with stages
in 2 minutes and 39 seconds
......@@ -30,14 +30,12 @@ class TrackMutationSerializer(mutations.UpdateMutationSerializer):
)
@mutations.registry.connect(
"update",
models.Artist,
perm_checkers={"suggest": can_suggest, "approve": can_approve},
)
class ArtistMutationSerializer(mutations.UpdateMutationSerializer):
class Meta:
model = models.Artist
fields = ["name"]
......@@ -54,7 +52,6 @@ class ArtistMutationSerializer(mutations.UpdateMutationSerializer):
perm_checkers={"suggest": can_suggest, "approve": can_approve},
)
class AlbumMutationSerializer(mutations.UpdateMutationSerializer):
class Meta:
model = models.Album
fields = ["title", "release_date"]
......
......@@ -5,10 +5,7 @@ from funkwhale_api.music import licenses
@pytest.mark.parametrize(
'field, old_value, new_value, expected',
[
('name', 'foo', 'bar', 'bar'),
]
"field, old_value, new_value, expected", [("name", "foo", "bar", "bar")]
)
def test_artist_mutation(field, old_value, new_value, expected, factories, now, mocker):
dispatch = mocker.patch("funkwhale_api.federation.routes.outbox.dispatch")
......@@ -26,11 +23,16 @@ def test_artist_mutation(field, old_value, new_value, expected, factories, now,
@pytest.mark.parametrize(
'field, old_value, new_value, expected',
"field, old_value, new_value, expected",
[
('title', 'foo', 'bar', 'bar'),
('release_date', datetime.date(2016, 1, 1), '2018-02-01', datetime.date(2018, 2, 1)),
]
("title", "foo", "bar", "bar"),
(
"release_date",
datetime.date(2016, 1, 1),
"2018-02-01",
datetime.date(2018, 2, 1),
),
],
)
def test_album_mutation(field, old_value, new_value, expected, factories, now, mocker):
dispatch = mocker.patch("funkwhale_api.federation.routes.outbox.dispatch")
......@@ -46,6 +48,7 @@ def test_album_mutation(field, old_value, new_value, expected, factories, now, m
{"type": "Update", "object": {"type": "Album"}}, context={"album": album}
)
def test_track_license_mutation(factories, now):
track = factories["music.Track"](license=None)
mutation = factories["common.Mutation"](
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment