3 Test mixin for testing forms
6 def assert_missing_fields(self
, cls
, data
, fields
=None):
8 Tests fields that should raise a required exception
10 @param cls - form class
11 @param data - dict of valid data
12 @param fields - list of field names that are required
14 fields
= data
.keys
if fields
is None else fields
16 # check required fields
21 self
.assertFalse(form
.is_valid())
23 def assert_invalid_value(self
, cls
, data
, fields
):
25 Tests fields that should raise an error for a specific type of invalid
28 @param cls - form class
29 @param data - dict of valid data
30 @param fields - list of dicts containing field name and
34 # check required fields
39 self
.assertFalse(form
.is_valid())