from django.utils import timezone
from webapp.models import Event
from webapp.utils import month_from_now


def createEventObject(
    name="Testitapahtuma1",
    visible=True,
    start_time=timezone.now(),
    end_time=month_from_now(),
    tag_id=[],
    signup_id=[],
):
    return Event.objects.create(
        title_fi=name,
        title_en=f"title_en {name}",
        visible=visible,
        description_fi=f"desc_fi {name}",
        description_en=f"desc_en {name}",
        content_fi=f"content_fi {name}",
        content_en=f"content_en {name}",
        start_time=start_time,
        end_time=end_time,
        location=f"loc {name}",
    )


def createEventJSON(
    name="POST1",
    visible=True,
    start_time=timezone.now(),
    end_time=month_from_now(),
    tag_id=[],
    signup_id=[],
):
    return {
        "tag_id": tag_id,
        "visible": visible,
        "title_fi": f"title_fi {name}",
        "title_en": f"title_en {name}",
        "description_fi": f"desc_fi {name}",
        "description_en": f"desc_en {name}",
        "content_fi": f"content_fi {name}",
        "content_en": f"content_en {name}",
        "start_time": start_time,
        "end_time": end_time,
        "location": f"loc {name}",
        "signup_id": signup_id,
    }
