mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 04:52:40 +00:00
Chore: add CustomFieldFactory
This commit is contained in:
1 parent
65fdfcdea7
commit
9ff48ecfce
3 files changed
+19
-8
No files matched your search
@@ -8,6 +8,7 @@ import factory
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from documents.models import Correspondent
|
||||
from documents.models import CustomField
|
||||
from documents.models import Document
|
||||
from documents.models import DocumentBarcode
|
||||
from documents.models import DocumentType
|
||||
@@ -48,6 +49,14 @@ class TagFactory(TypedModelFactory[Tag]):
|
||||
is_inbox_tag = False
|
||||
|
||||
|
||||
class CustomFieldFactory(TypedModelFactory[CustomField]):
|
||||
class Meta:
|
||||
model = CustomField
|
||||
|
||||
name = factory.Sequence(lambda n: f"Custom field {n}")
|
||||
data_type = CustomField.FieldDataType.STRING
|
||||
|
||||
|
||||
class StoragePathFactory(TypedModelFactory[StoragePath]):
|
||||
class Meta:
|
||||
model = StoragePath
|
||||
|
||||
Reference in new issue
Block a user