Django storage for fake.py
项目描述
fake-py-django-storage 是 Django storage integration for fake.py - 一个独立、便携的库,用于生成各种随机数据类型以进行测试。
功能
与 Django (和 django-storages) 几乎无缝集成。
先决条件
Python 3.9+
安装
pip install fake-py-django-storage
文档
文档可在 Read the Docs 上找到。
有关贡献指南,请参阅 贡献指南。
用法
Django 的 FileSystemStorage
from fake import FAKER
from fakepy.django_storage.filesystem import DjangoFileSystemStorage
STORAGE = DjangoFileSystemStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
AWS S3(使用 django-storages)
from fake import FAKER
from fakepy.django_storage.aws_s3 import DjangoAWSS3Storage
STORAGE = DjangoAWSS3Storage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
Google Cloud Storage(使用 django-storages)
from fake import FAKER
from fakepy.django_storage.google_cloud_storage import (
DjangoGoogleCloudStorage,
)
STORAGE = DjangoGoogleCloudStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
Azure Cloud Storage(使用 django-storages)
from fake import FAKER
from fakepy.django_storage.azure_cloud_storage import (
DjangoAzureCloudStorage,
)
STORAGE = DjangoAzureCloudStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
测试
pytest
编写文档
保持以下层次结构。
=====
title
=====
header
======
sub-header
----------
sub-sub-header
~~~~~~~~~~~~~~
sub-sub-sub-header
^^^^^^^^^^^^^^^^^^
sub-sub-sub-sub-header
++++++++++++++++++++++
sub-sub-sub-sub-sub-header
**************************
许可证
MIT 许可证
支持
对于安全问题,请联系作者部分的电子邮件地址。
对于总体问题,请访问 GitHub。
项目详情
下载文件
下载适用于您平台的应用程序。如果您不确定要选择哪个,请了解更多关于 安装包 的信息。
源代码分发
fake_py_django_storage-0.1.1.tar.gz (32.6 kB 查看哈希值)
构建分发
关闭
哈希值 for fake_py_django_storage-0.1.1-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 855f9911f7a2b8da81d0a32680c61b830f8ce3f7df7fe048779af82e9bded587 |
|
MD5 | 8afad2d63f4cacbcf93970b347908234 |
|
BLAKE2b-256 | 9f837e4d0e2a829f1718433e0afa13a8bd6f51b464a0562365612d6ea7e8bb6f |