romove unused code
This commit is contained in:
parent
3ae34ecfd4
commit
c072f67a4a
|
@ -359,22 +359,6 @@ CONTEXTS = [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"shortId": "MB",
|
|
||||||
"contextUrl": None,
|
|
||||||
"documentUrl": "http://musicbrainz.org/ns/mmd-1.0#",
|
|
||||||
"document": {
|
|
||||||
"@context": {
|
|
||||||
"mb": "http://musicbrainz.org/ns/mmd-1.0#",
|
|
||||||
"schema": "http://schema.org#",
|
|
||||||
"Recording": "schema:MusicRecording",
|
|
||||||
"name": "schema:name",
|
|
||||||
"duration": "schema:duration",
|
|
||||||
"@id": "@id",
|
|
||||||
"@type": "@type",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
CONTEXTS_BY_ID = {c["shortId"]: c for c in CONTEXTS}
|
CONTEXTS_BY_ID = {c["shortId"]: c for c in CONTEXTS}
|
||||||
|
@ -408,4 +392,3 @@ SEC = NS(CONTEXTS_BY_ID["SEC"])
|
||||||
FW = NS(CONTEXTS_BY_ID["FW"])
|
FW = NS(CONTEXTS_BY_ID["FW"])
|
||||||
SC = NS(CONTEXTS_BY_ID["SC"])
|
SC = NS(CONTEXTS_BY_ID["SC"])
|
||||||
LITEPUB = NS(CONTEXTS_BY_ID["LITEPUB"])
|
LITEPUB = NS(CONTEXTS_BY_ID["LITEPUB"])
|
||||||
MB = NS(CONTEXTS_BY_ID["MB"])
|
|
||||||
|
|
|
@ -736,87 +736,3 @@ def test_fetch_webfinger_create_actor(factories, r_mock, mocker):
|
||||||
assert init.call_args[0][1] == actor
|
assert init.call_args[0][1] == actor
|
||||||
assert init.call_args[1]["data"] == payload
|
assert init.call_args[1]["data"] == payload
|
||||||
assert save.call_count == 1
|
assert save.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
def test_third_party_fetch_success(factories, r_mock, mocker):
|
|
||||||
track = factories["music.Track"]()
|
|
||||||
url = f"https://musicbrainz.org/recording/{track.mbid}"
|
|
||||||
fetch = factories["federation.Fetch"](url=url)
|
|
||||||
payload = {
|
|
||||||
"releases": [
|
|
||||||
{
|
|
||||||
"status": "Promotion",
|
|
||||||
"id": "220ffb88-49ed-4df4-a330-46f8e7353ff0",
|
|
||||||
"country": "DE",
|
|
||||||
"title": "With Oi! To Hope for Myanmar 2022",
|
|
||||||
"quality": "normal",
|
|
||||||
"release-events": [
|
|
||||||
{
|
|
||||||
"area": {
|
|
||||||
"name": "Germany",
|
|
||||||
"id": "85752fda-13c4-31a3-bee5-0e5cb1f51dad",
|
|
||||||
"sort-name": "Germany",
|
|
||||||
"disambiguation": "",
|
|
||||||
"iso-3166-1-codes": ["DE"],
|
|
||||||
},
|
|
||||||
"date": "2022",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"disambiguation": "Version aus 2022",
|
|
||||||
"status-id": "518ffc83-5cde-34df-8627-81bff5093d92",
|
|
||||||
"packaging-id": "8f931351-d2e2-310f-afc6-37b89ddba246",
|
|
||||||
"artist-credit": [
|
|
||||||
{
|
|
||||||
"artist": {
|
|
||||||
"sort-name": "Various Artists",
|
|
||||||
"name": "Various Artists",
|
|
||||||
"disambiguation": "add compilations to this artist",
|
|
||||||
"type": "Other",
|
|
||||||
"type-id": "ac897045-5043-3294-969b-187360e45d86",
|
|
||||||
"id": "89ad4ac3-39f7-470e-963a-56509c546377",
|
|
||||||
},
|
|
||||||
"joinphrase": "",
|
|
||||||
"name": "Various Artists",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"barcode": "",
|
|
||||||
"date": "2022",
|
|
||||||
"packaging": "Digipak",
|
|
||||||
"text-representation": {"language": "mul", "script": "Latn"},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"disambiguation": "",
|
|
||||||
"video": False,
|
|
||||||
"first-release-date": "2022",
|
|
||||||
"artist-credit": [
|
|
||||||
{
|
|
||||||
"artist": {
|
|
||||||
"name": "The Rebel Riot",
|
|
||||||
"disambiguation": "",
|
|
||||||
"sort-name": "Rebel Riot, The",
|
|
||||||
"type": "Group",
|
|
||||||
"id": "1ff2cd0c-2ac1-4296-b650-77ef57bb0d01",
|
|
||||||
"country": "MM",
|
|
||||||
"type-id": "e431f5f6-b5d2-343d-8b36-72607fffb74b",
|
|
||||||
},
|
|
||||||
"name": "The Rebel Riot",
|
|
||||||
"joinphrase": "",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": "A.C.A.B.",
|
|
||||||
"id": "455cd030-7394-4244-9a53-3b96a666b1c6",
|
|
||||||
"length": 193253,
|
|
||||||
}
|
|
||||||
init = mocker.spy(serializers.ArtistSerializer, "__init__")
|
|
||||||
save = mocker.spy(serializers.ArtistSerializer, "save")
|
|
||||||
|
|
||||||
r_mock.get(url, json=payload)
|
|
||||||
|
|
||||||
tasks.third_party_fetch(fetch_id=fetch.pk)
|
|
||||||
|
|
||||||
fetch.refresh_from_db()
|
|
||||||
|
|
||||||
assert fetch.status == "finished"
|
|
||||||
assert init.call_count == 1
|
|
||||||
assert init.call_args[1]["data"] == payload
|
|
||||||
assert save.call_count == 1
|
|
||||||
|
|
Loading…
Reference in New Issue