diff --git a/ckan/new_tests/lib/navl/test_validators.py b/ckan/new_tests/lib/navl/test_validators.py index 1d0f526b273..1e34b51face 100644 --- a/ckan/new_tests/lib/navl/test_validators.py +++ b/ckan/new_tests/lib/navl/test_validators.py @@ -26,6 +26,9 @@ def test_ignore_missing_with_None(self): # ignore_missing should remove the item from the dict. assert key not in data + # ignore_missing should not add any errors. + assert errors[key] == [] + def test_ignore_missing_with_missing(self): '''If data[key] is missing ignore_missing() should raise StopOnError. @@ -47,6 +50,9 @@ def test_ignore_missing_with_missing(self): # ignore_missing should remove the item from the dict. assert key not in data + # ignore_missing should not add any errors. + assert errors[key] == [] + def test_ignore_missing_without_key(self): '''If key is not in data ignore_missing() should raise StopOnError.''' @@ -67,6 +73,9 @@ def test_ignore_missing_without_key(self): # ignore_missing should remove the item from the dict. assert key not in data + # ignore_missing should not add any errors. + assert errors[key] == [] + def test_ignore_missing_with_a_value(self): '''If data[key] is neither None or missing, ignore_missing() should do nothing. @@ -82,4 +91,9 @@ def test_ignore_missing_with_a_value(self): context={}) assert result is None + + # ignore_missing shouldn't remove or modify the value. assert data.get(key) == 'bar' + + # ignore_missing shouldn't add any errors. + assert errors[key] == []