def test_fitting_is_not_condenser(self):
"""
Tests that a validation error is raised if the target field is an
EmbeddedDocument and the content type is not a Condenser.
"""
field = BottleField.objects.get_by_natural_key('content')
fitting = MailFitting(
condenser=self.condenser,
target_field=field,
object_id=3,
content_type=self.parser_type
)
with six.assertRaisesRegex(self, ValidationError, 'If the '
'target field is an EmbeddedDocument, '
'the content type must be a condenser.'):
fitting.clean()
评论列表
文章目录