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