@@ -1868,8 +1868,9 @@ def test_validate_only_collects_missing_field_errors(self):
18681868
18691869 assert result is not None
18701870 assert isinstance (result , ValidationResult )
1871- # Should have warnings about missing field
1872- assert any ("Nonsense__c" in warning for warning in result .warnings )
1871+ assert result .has_errors ()
1872+ # Should have errors about missing field
1873+ assert any ("Nonsense__c" in error for error in result .errors )
18731874
18741875 @responses .activate
18751876 def test_validate_only_collects_missing_required_field_errors (self ):
@@ -1930,8 +1931,9 @@ def test_validate_only_early_return_on_sobject_error(self):
19301931
19311932 assert result is not None
19321933 assert isinstance (result , ValidationResult )
1933- # Should have warning about missing object
1934- assert any ("InvalidObject__c" in warning for warning in result .warnings )
1934+ assert result .has_errors ()
1935+ # Should have error about missing object
1936+ assert any ("InvalidObject__c" in error for error in result .errors )
19351937
19361938 @responses .activate
19371939 def test_validate_only_collects_lookup_errors (self ):
@@ -2068,7 +2070,7 @@ def test_check_required_without_validation_result_logs(self, caplog):
20682070 assert "Name" in caplog .text
20692071
20702072 def test_validate_sobject_with_validation_result (self ):
2071- """Test _validate_sobject adds warnings to ValidationResult"""
2073+ """Test _validate_sobject adds errors to ValidationResult"""
20722074 from cumulusci .tasks .bulkdata .mapping_parser import ValidationResult
20732075
20742076 ms = MappingStep (
@@ -2087,13 +2089,11 @@ def test_validate_sobject_with_validation_result(self):
20872089 )
20882090
20892091 assert not result
2090- assert len (validation_result .warnings ) > 0
2091- assert any (
2092- "InvalidObject__c" in warning for warning in validation_result .warnings
2093- )
2092+ assert validation_result .has_errors ()
2093+ assert any ("InvalidObject__c" in error for error in validation_result .errors )
20942094
20952095 def test_validate_field_dict_with_validation_result (self ):
2096- """Test _validate_field_dict adds warnings to ValidationResult"""
2096+ """Test _validate_field_dict adds errors to ValidationResult"""
20972097 from cumulusci .tasks .bulkdata .mapping_parser import ValidationResult
20982098
20992099 ms = MappingStep (
@@ -2114,10 +2114,8 @@ def test_validate_field_dict_with_validation_result(self):
21142114 )
21152115
21162116 assert not result
2117- assert len (validation_result .warnings ) > 0
2118- assert any (
2119- "NonexistentField__c" in warning for warning in validation_result .warnings
2120- )
2117+ assert validation_result .has_errors ()
2118+ assert any ("NonexistentField__c" in error for error in validation_result .errors )
21212119
21222120 def test_infer_and_validate_lookups_with_validation_result (self ):
21232121 """Test _infer_and_validate_lookups adds errors to ValidationResult"""
@@ -2235,10 +2233,11 @@ def test_validate_field_dict_permission_error_with_validation_result(self):
22352233 )
22362234
22372235 assert not result
2238- # Should have warning about incorrect permissions
2236+ assert validation_result .has_errors ()
2237+ # Should have error about incorrect permissions
22392238 assert any (
2240- "does not have the correct permissions" in warning
2241- for warning in validation_result .warnings
2239+ "does not have the correct permissions" in error
2240+ for error in validation_result .errors
22422241 )
22432242
22442243 def test_validate_sobject_permission_error_with_validation_result (self ):
@@ -2261,10 +2260,11 @@ def test_validate_sobject_permission_error_with_validation_result(self):
22612260 )
22622261
22632262 assert not result
2264- # Should have warning about incorrect permissions
2263+ assert validation_result .has_errors ()
2264+ # Should have error about incorrect permissions
22652265 assert any (
2266- "does not have the correct permissions" in warning
2267- for warning in validation_result .warnings
2266+ "does not have the correct permissions" in error
2267+ for error in validation_result .errors
22682268 )
22692269
22702270 def test_infer_and_validate_lookups_invalid_reference_with_validation_result (self ):
0 commit comments