Example #1
0
    def test_esd_function_validator_empty_value(self):

        context = {}
        value = ''

        validated_value = esd_function_validator(value, context)

        assert_equals(validated_value, None)
Example #2
0
    def test_esd_function_validator_title(self):

        context = {}
        value = 'Youth offending'

        validated_value = esd_function_validator(value, context)

        assert_equals(validated_value, 'http://id.esd.org.uk/function/22')
Example #3
0
    def test_esd_function_validator_id(self):

        context = {}
        value = '22'

        validated_value = esd_function_validator(value, context)

        assert_equals(validated_value, 'http://id.esd.org.uk/function/22')
Example #4
0
    def test_esd_function_validator_uris(self):

        context = {}
        value = 'http://id.esd.org.uk/function/22 http://id.esd.org.uk/function/23'

        validated_value = esd_function_validator(value, context)

        assert_equals(validated_value, value)
Example #5
0
    def test_esd_function_validator_titles(self):

        context = {}
        value = 'Youth offending,Education and learning'

        validated_value = esd_function_validator(value, context)

        value_spaces = 'http://id.esd.org.uk/function/22 http://id.esd.org.uk/function/23'
        assert_equals(validated_value, value_spaces)
Example #6
0
    def test_esd_function_validator_ids_commas(self):

        context = {}
        value = '22,23'

        validated_value = esd_function_validator(value, context)

        value_spaces = 'http://id.esd.org.uk/function/22 http://id.esd.org.uk/function/23'
        assert_equals(validated_value, value_spaces)