Fixed #44: now bind track file to import job

This commit is contained in:
Eliot Berriot 2017-12-14 23:06:21 +01:00
parent a08bf51216
commit e90e9dc7aa
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
14 changed files with 181 additions and 16 deletions

View file

@ -39,3 +39,13 @@ def test_import_album_stores_release_group(db):
assert album.release_group_id == album_data['release-group']['id']
assert album.artist == artist
def test_import_job_is_bound_to_track_file(db, mocker):
track = factories.TrackFactory()
job = factories.ImportJobFactory(mbid=track.mbid)
mocker.patch('funkwhale_api.music.models.TrackFile.download_file')
job.run()
job.refresh_from_db()
assert job.track_file.track == track