from webapp.models import Tag
import tempfile


def createTagIcon():
    return tempfile.NamedTemporaryFile(suffix=".jpg").name


def tagBuilder(slug="Tag1", icon=createTagIcon()):
    return Tag.objects.create(
        slug=slug, name_fi=slug + " name_fi", name_en=slug + " name_en", icon=icon
    )
