From 7e47cf4335f7638b6f85c31992aca21065b4af6c Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Sun, 3 Dec 2023 23:31:14 +0100 Subject: [PATCH] Test examples --- docs/creating_images.rst | 6 +++--- docs/factories.rst | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/creating_images.rst b/docs/creating_images.rst index 022e6c7..202b404 100644 --- a/docs/creating_images.rst +++ b/docs/creating_images.rst @@ -4,9 +4,9 @@ Creating images .. _faker-file: https://pypi.org/project/faker-file/ -Creating images could be a challenging task. The goal of this library -is to help you out with basic tasks. You can easily generate very basic -graphic images, but no custom shapes. Paper size is A4. +Creating images for testing could be a challenging job. The goal of this +library is to help you out with basic tasks. You can easily generate very +basic graphic images, but no custom shapes. Paper size is A4. If you don't like how image files are generated by this library, you can check the `faker-file`_ package, which can produce complex images. diff --git a/docs/factories.rst b/docs/factories.rst index 8032d77..131a37b 100644 --- a/docs/factories.rst +++ b/docs/factories.rst @@ -42,6 +42,10 @@ Django example from article.models import Article + # For Django, all files shall be placed inside `MEDIA_ROOT` directory. + # That's why you need to apply this trick - define a + # custom `FileSystemStorage` class and pass it to the file factory as + # `storage` argument. STORAGE = FileSystemStorage(root_path=settings.MEDIA_ROOT, rel_path="tmp") class UserFactory(DjangoModelFactory):