Skip to main content

Helper package for django unittest

Project description

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

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

from django_unittest_helper import generate_random_phone_no

phone_no = generate_random_phone_no(prefix="013", total_digit=11)

The above code will return a dummy phone number based on random digits

There 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_unittest_helper-0.3-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page