File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1506,19 +1506,18 @@ def test_cf_data(self):
15061506
15071507 def test_invalid_data (self ):
15081508 """
1509- Setting custom field data for a non-applicable (or non-existent) CustomField should raise a ValidationError .
1509+ Any invalid or stale custom field data should be removed from the instance .
15101510 """
15111511 site = Site (name = 'Test Site' , slug = 'test-site' )
15121512
15131513 # Set custom field data
15141514 site .custom_field_data ['foo' ] = 'abc'
15151515 site .custom_field_data ['bar' ] = 'def'
1516- with self .assertRaises (ValidationError ):
1517- site .clean ()
1518-
1519- del site .custom_field_data ['bar' ]
15201516 site .clean ()
15211517
1518+ self .assertIn ('foo' , site .custom_field_data )
1519+ self .assertNotIn ('bar' , site .custom_field_data )
1520+
15221521 def test_missing_required_field (self ):
15231522 """
15241523 Check that a ValidationError is raised if any required custom fields are not present.
You can’t perform that action at this time.
0 commit comments