import datetime

import structlog
from django.utils import timezone
from factory.django import DjangoModelFactory

from .models import DueDate

logger = structlog.get_logger(__name__)


def get_date(date_string):
    return datetime.datetime.strptime(
        date_string,
        "%b %d %Y",
    ).astimezone(timezone.get_current_timezone())


class DueDateFactory(DjangoModelFactory):
    class Meta:
        model = DueDate

    title = "Prüfung Versicherungsvermittler/-in"
    end = get_date("Jan 01 2021")
