tests.models.input.definitions package

Submodules

tests.models.input.definitions.test_boolean_input_definition module

class tests.models.input.definitions.test_boolean_input_definition.BooleanInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the BooleanInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_default_blank_and_null()

Tests that the default field may be blank or null.

test_get_type()

Tests the get_type() return the expected value.

test_input_class_attribute()

Test the input_class attribute is set to BooleanInput

tests.models.input.definitions.test_file_input_definition module

class tests.models.input.definitions.test_file_input_definition.FileInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the FileInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_default_is_none()

The FileInputDefinition does not currently support a default value definition and therefore is expected to be None.

test_get_type()

Tests the get_type() method returns the expected value.

test_input_class_attribute()

Test the input_class attribute is set to FileInput.

tests.models.input.definitions.test_float_input_definition module

class tests.models.input.definitions.test_float_input_definition.FloatInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the FloatInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_default_blank_and_null()

Tests that the default field may be blank or null.

test_default_may_be_nulled()

Tests that the default field may be set to null without raising a ValidationError or any other exception.

test_get_type()

Tests the get_type() method returns the expected value.

test_input_class_attribute()

Test the input_class attribute is set to FloatInput

test_max_value_blank_and_null()

Tests that the max_value field may be blank or null.

test_max_value_may_be_nulled()

Tests that the max_value field may be set to null without raising a ValidationError or any other exception.

test_max_value_validation()

Tests that a ValidationError is raised if the default value is greater than the max_value definition.

test_min_value_blank_and_null()

Tests that the min_value field may be blank or null.

test_min_value_may_be_nulled()

Tests that the min_value field may be set to null without raising a ValidationError or any other exception.

test_min_value_validation()

Tests that a ValidationError is raised if the default value is lesser than the min_value definition.

tests.models.input.definitions.test_input_definition module

class tests.models.input.definitions.test_input_definition.InputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the InputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_create_input_instance_raises_type_error()

Tests that calling the create_input_instance() raises a ValidationError. This is the expected behavior as long as the input_class attribute is not defined (or ill defined).

test_create_input_instance_reraises_uncaught_exception()

Tests that calling the create_input_instance() method when input_class is properly set but invalid kwargs still raises an exception.

test_create_input_instance_with_non_input_subclass_value_raises_type_error()

Tests that calling the create_input_instance() with a non-Input model subclass value raises a ValidationError.

test_create_input_instance_with_non_model_value_raises_type_error()

Tests that calling the create_input_instance() with a non-model value raises a ValidationError.

test_custom_manager_is_assigned()

Tests that the manager is assigned to be the custom InputDefinitionManager class.

test_default_field_is_none()

Tests that the default field is set to None. This field is meant to be overriden by a Field instance.

test_description_blank_and_null()

Tests that the description field may be blank or null.

test_input_class_is_none()

Tests that the input_class class attribute is set to None. This is meant to be overriden by a Input instance.

test_is_configuration_default_value()

Test the default value of the is_configuration field.

test_key_blank_and_null()

Tests that the key field may not be blank or null.

test_key_is_not_unique()

Tests that the key field is not unique.

test_key_max_length()

Test the max_length of the key field.

test_ordering()

Test the ordering.

test_required_default_value()

Test the default value of the required field.

test_resetting_input_class_to_valid_input_subclass()

Tests that the check_input_class_definition() method does not raise a ValidationError when setting input_class to some valid Input model subclass.

test_string()

Test the string output.

tests.models.input.definitions.test_integer_input_definition module

class tests.models.input.definitions.test_integer_input_definition.IntegerInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the IntegerInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_default_blank_and_null()

Tests that the default field may be blank or null.

test_default_may_be_nulled()

Tests that the default field may be set to null without raising a ValidationError or any other exception.

test_get_type()

Tests the get_type() method returns the expected value.

test_input_class_attribute()

Test the input_class attribute is set to IntegerInput

test_max_value_blank_and_null()

Tests that the max_value field may be blank or null.

test_max_value_may_be_nulled()

Tests that the max_value field may be set to null without raising a ValidationError or any other exception.

test_max_value_validation()

Tests that a ValidationError is raised if the default value is greater than the max_value definition.

test_min_value_blank_and_null()

Tests that the min_value field may be blank or null.

test_min_value_may_be_nulled()

Tests that the min_value field may be set to null without raising a ValidationError or any other exception.

test_min_value_validation()

Tests that a ValidationError is raised if the default value is lesser than the min_value definition.

tests.models.input.definitions.test_list_input_definition module

class tests.models.input.definitions.test_list_input_definition.ListInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the ListInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_default_blank_and_null()

Tests that the default field may be blank or null.

test_get_type()

Tests the get_type() method returns the expected length.

test_input_class_attribute()

Test the input_class attribute is set to ListInput

test_max_length_blank_and_null()

Tests that the max_length field may be blank or null.

test_max_length_validation()

Tests that a ValidationError is raised if the default’s length is greater than the max_length definition.

test_min_length_blank_and_null()

Tests that the min_length field may be blank or null.

test_min_length_validation()

Tests that a ValidationError is raised if the default’s length is lesser than the min_length definition.

test_resetting_default_to_valid_value()

Tests that setting the default value to a different value that is valid does not raise a ValidationError.

test_setting_default_to_non_list_raises_validation_error()

Tests that setting the default value to a non-list value raises a validation error.

test_wrong_element_type_raises_validation_error()

Tests that a ValidationError is raised if the default’s element type does not match the element_type field value.

tests.models.input.definitions.test_string_input_definition module

class tests.models.input.definitions.test_string_input_definition.StringInputDefinitionTestCase(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests for the StringInputDefinition model.

setUp()

Adds the created instances to the tests’ contexts. For more information see unittest’s setUp() method.

test_choices_blank_and_null()

Tests that the choices field may be blank or null.

test_default_blank_and_null()

Tests that the default field may be blank or null.

test_default_max_length()

Tests the default field’s max_length value.

test_get_type()

Tests the get_type() method returns the expected value.

test_input_class_attribute()

Test the input_class attribute is set to StringInput

test_is_output_path_blank_and_null()

Tests that the is_output_path field may be blank or null.

test_is_output_path_default_value()

Tests the is_output_path field’s default value.

test_max_length_blank_and_null()

Tests that the max_length field may be blank or null.

test_min_length_blank_and_null()

Tests that the min_length field may be blank or null.

test_validation_with_default_and_without_choices()

Tests the validate() methods does not raise a ValidationError if the choices field is null when default is set.

test_validation_with_default_from_choices()

Tests the validate() methods does not raise a ValidationError if the choices field is set and contains the default value.

test_validation_with_default_not_from_choices()

Tests the validate() methods raises a ValidationError if the choices field is set and does not contains the default value.

test_validation_without_default_and_without_choices()

Tests the validate() methods does not raise a ValidationError if the choices and default fields are null.

Module contents