# -*- coding: utf-8 -*-
from __future__ import annotations

import hashlib

import factory

from hotpocket_backend.apps.saves.models import Save


class SaveFactory(factory.django.DjangoModelFactory):
    account_uuid = None
    deleted_at = None
    key = factory.LazyAttribute(lambda obj: hashlib.sha256(obj.url.encode('utf-8')).hexdigest())
    url = None
    content = None
    title = None
    description = None
    last_processed_at = None
    is_netloc_banned = False

    class Meta:
        model = Save
