Skip to content

Commit

Permalink
Improvements to README.md and setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Dart committed Jul 16, 2020
1 parent 0be1be6 commit 11b214c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FormStorm (v1.0.0)
# FormStorm (v1.0)

FormStorm is a Python library that easily creates unit tests for Django forms by defining valid/invalid values for each field. All combinations of the fields' predefined values are submitted to the form to validate each field and test for unintended interdependence between fields. In addition to testing single- and multi-field validation, FormStorm can also test single-field uniqueness constraints by double-submitting a valid submission and checking which fields become invalid on the 2nd submission.
FormStorm is a Python library that easily creates unit tests for Django forms. Given valid and invalid values for each field, the library computes every combination of the fields' values and submits them to the form. This validates all of the fields and tests for unintended interdependence between fields. In addition to testing single- and multi-field validation, FormStorm can also test single-field uniqueness constraints by double-submitting a valid submission and checking which fields become invalid on the 2nd submission.

## Example:

Expand Down Expand Up @@ -99,9 +99,11 @@ Validating multi-field constraints can be tested by specifying the values (as a
- End-to-end testing (with Selenium): This is partially implemented, and most of the necessary FormStorm functions have been abstracted. Just need to subclass FormTest and fully implement.
- Tests for DRF Serializers. "SerializerStorm"
- Set up CI
- Handle the obscure, "long tail" cases by implementing a framework to define tests for any type of constraint (such as multi-column uniqueness constraints). To do this, a "sub-test" would define one or more form submissions and the (boolean) result expected. Sub-tests would be combined with each other and with the standard combinatorial mix of good/bad values so that all fields are tested simultaneously. A tentative definition of the sub-tests is below:
- Handle the obscure, "long tail" cases by implementing a framework to define tests for any type of constraint (such as multi-column uniqueness constraints). To do this, a "sub-test" would define one or more form submissions and the (boolean) result expected. Sub-tests would be combined with each other and with the standard combinatorial mix of good/bad values so that all fields are tested simultaneously.


A tentative definition of the sub-tests is below:

sub_tests = [
{ # Sub-test 1
field_names=["field1","field2",..."fieldN"],
Expand Down
2 changes: 1 addition & 1 deletion formstorm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .FormTest import FormTest # noqa: F401
from .FormElement import FormElement # noqa: F401

__version__ = '1.0.0'
__version__ = '1.0'
name = "formstorm"
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
from setuptools import find_packages, setup
from formstorm import __version__ as version_string
from os import path


this_directory = path.abspath(path.dirname(__file__))
readme_path = path.join(this_directory, 'README.md')
with open(readme_path, encoding='utf-8') as f:
long_description = f.read()

setup(
name='formstorm',
version=version_string,
url='https://github.com/TravisDart/formstorm/',
description=(
'FormStorm is a Python library that easily creates unit tests for '
'Django forms by defining valid/invalid values for each field.'
'FormStorm is a library that easily creates unit tests for Django '
'forms.'
),
license='MIT',
author='Travis Dart',
Expand All @@ -23,4 +29,6 @@
'Topic :: Software Development :: Testing',
],
packages=find_packages(),
long_description=long_description,
long_description_content_type='text/markdown'
)

0 comments on commit 11b214c

Please sign in to comment.