def test_invalid_target_field(self):
"""
Tests that a validation error is raised if the target_field is not
present in the Bottle associated with the Fitting's Condenser.
"""
field = BottleField.objects.get_by_natural_key('subject')
fitting = MailFitting(
condenser=self.condenser,
target_field=field,
object_id=2,
content_type=self.parser_type
)
with six.assertRaisesRegex(self, ValidationError, 'The selected '
'target field is not compatible with the '
'condenser\'s bottle.'):
fitting.clean()
评论列表
文章目录