2018-05-15 21:59:29 +02:00
|
|
|
import os
|
2018-07-09 22:35:32 +02:00
|
|
|
import uuid
|
2018-02-22 23:33:29 +01:00
|
|
|
|
2022-11-23 12:11:36 +01:00
|
|
|
import pytest
|
2018-07-09 22:35:32 +02:00
|
|
|
from django import forms
|
2018-02-22 23:33:29 +01:00
|
|
|
|
2022-11-23 12:11:36 +01:00
|
|
|
from funkwhale_api.music import importers, models
|
2018-04-05 23:22:28 +02:00
|
|
|
|
2018-05-15 21:59:29 +02:00
|
|
|
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
2018-02-22 23:33:29 +01:00
|
|
|
|
2018-07-09 22:35:32 +02:00
|
|
|
def test_importer_cleans():
|
|
|
|
|
importer = importers.Importer(models.Artist)
|
|
|
|
|
with pytest.raises(forms.ValidationError):
|
|
|
|
|
importer.load({"name": "", "mbid": uuid.uuid4()}, {}, [])
|