def test_author_of_first_chunk_must_also_be_vollume_author(self):
vollume = Vollume(
author=create_and_save_dummy_user(username='Mickey'),
title='Top dollar mate'
)
vollume.save()
chunk = VollumeChunk(
vollume=vollume,
author=create_and_save_dummy_user(username='Steves'),
text="Huh? Yeah, I just feel like... you know when you roll a blinding spliff?"
)
with self.assertRaises(ValidationError) as caught:
chunk.full_clean()
error_messages = caught.exception.message_dict[NON_FIELD_ERRORS]
self.assertIn("The author of the first paragraph of a Vollume must also be the Vollume author.", error_messages)
评论列表
文章目录