def test_error_message(self):
        field = DjangoModelField(MyModel2, pk="other_pk")
        myModel2 = MyModel2.objects.create(other_pk=999)
        try:
            field.to_python(666)
        except __HOLE__, e:
            self.assertEquals(e.message, 'No match found for MyModel2')
        else:
            self.assertTrue(False, "No exception raised")
        self.assertEquals(field.to_python(myModel2.other_pk), myModel2)
dataset/ETHPy150Open anthony-tresontani/django-adaptors/tests/csv_tests.py/TestFields.test_error_message