You've already forked hotpocket
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
from .association import AssociationFactory # noqa: F401,F403
|
||||
from .save import SaveFactory # noqa: F401,F403
|
||||
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
import factory
|
||||
|
||||
from hotpocket_backend.apps.saves.models import Association
|
||||
|
||||
|
||||
class AssociationFactory(factory.django.DjangoModelFactory):
|
||||
account_uuid = None
|
||||
deleted_at = None
|
||||
archived_at = None
|
||||
starred_at = None
|
||||
target_meta = factory.LazyFunction(dict)
|
||||
target_title = None
|
||||
target_description = None
|
||||
|
||||
target = None
|
||||
|
||||
class Meta:
|
||||
model = Association
|
||||
@@ -0,0 +1,23 @@
|
||||
# -*- 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
|
||||
Reference in New Issue
Block a user