def test_contact_mismatch(self):
        self.data['contact'] = self.create_contact()
        with self.assertRaises(ValidationError):
            Message.objects.create(**self.data)
If both present, Contact and Connection Contact must match.
dataset/ETHPy150Open rapidsms/rapidsms/rapidsms/contrib/messagelog/tests/test_models.py/MessageLogModelTest.test_contact_mismatch