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