Tests if entity is prevented from being moved to different project in
case of existing communications.
"""
entity = Entity.objects.get(pk=1)
new_project = Project.objects.get(pk=2)
entity.project = new_project
self.assertRaisesRegexp(ValidationError, "The entity cannot be moved to different project as long as it has valid communications with entities in current project." ,entity.clean)