Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masudurhimel/django_unittest_helper
https://github.com/masudurhimel/django_unittest_helper
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/masudurhimel/django_unittest_helper
- Owner: masudurHimel
- License: mit
- Created: 2021-11-09T06:59:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T11:02:40.000Z (almost 3 years ago)
- Last Synced: 2024-10-16T11:29:38.032Z (21 days ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# django_unittest_image_helper
An open source package for helping the django unittest journey## Description
A Python library to facilitate the django unittesting journey.
## Installation
```
pip install django-unittest-helper```
## Usage#### For getting dummy form-data images for payload during unittesting
```python
from django_unittest_helper import form_image_helper
payload = form_image_helper(caption_list=['photo', 'map'], image_suffix=".jpg")```
The above code will return dummy images for api testing.
There are 2 parameters for this method-
1. ```caption_list``` : Provide caption titles for the payload in list.
2. ```image_suffix``` : Provide the extension of the images as per your need.#### For generating random phone number
```python
from django_unittest_helper import generate_random_phone_nophone_no = generate_random_phone_no(prefix="013", total_digit=11)
```
The above code will return a dummy phone number based on random digitsThere are 2 parameters for this method-
1. ```prefix``` : Provide the prefix of the operator of phone no
2. ```total_digit```: Provide the total digits of the phone number you need